VBAProIWish
Well-known Member
- Joined
- Jul 6, 2009
- Messages
- 1,027
- Office Version
- 365
- Platform
- Windows
Hello All,
I use this small line of code to auto fill my column past the 2nd row (not including the title row). 99% of the time, this code works perfectly because there are more than 2 rows of data.
The problem is that I get an error when there are only 2 rows of data (not including the title row).
How can I get it to say "hey, if there are only two rows, stop calculating and move on".
Thanks much
I use this small line of code to auto fill my column past the 2nd row (not including the title row). 99% of the time, this code works perfectly because there are more than 2 rows of data.
The problem is that I get an error when there are only 2 rows of data (not including the title row).
How can I get it to say "hey, if there are only two rows, stop calculating and move on".
Code:
Range("AO2:AO3").Select
Selection.AutoFill Destination:=Range("AO2:AO" & Range("A" & Rows.Count).End(xlUp).Row)
Thanks much