Run-time error

iwilli

New Member
Joined
Jan 31, 2012
Messages
43
New guy back again. I'm trying to clean up my macro I made using the recorder. This is the code and I get a Run-time error '1004': Application-defined or object-defined error. I don't know enough to know what the error is or how to fix it. For what it is worth the code is the very first thing in the macro. I was trying to type a column name in row F that says "AO Name" in F1. What am I doing wrong?

Code:
'   Find the last row with data. This might change every day
    FinalRow = Cells(Rows.Count, 1).End(x1Up).Row
    TotalRow = FinalRow + 1
    Range("F" & TotalRow).Value = "AO Name"
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Welcome to the board..

FinalRow = Cells(Rows.Count, 1).End(x1Up).Row
should be
FinalRow = Cells(Rows.Count, 1).End(xlUp).Row

It's the letter L, not the number One.


Hope that helps.
 
Upvote 0
Thanks! It solved the run-time error. It enters the "AO Name" in the last row and I want it in B2. What can I change to get this to work?
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top