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

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
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,216,471
Messages
6,130,822
Members
449,595
Latest member
jhester2010

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