Hello,
In my script in some part Im useing autofill and it works proprly but when I have 2 or more records. If there is non or one record my macro is crushing.
I have something similar in several places in my code. I just need to have Id in column A from A2 going downn (1, 2, 3 etc) and none if no records are there.
Can You guys help me fix this?
my code
In my script in some part Im useing autofill and it works proprly but when I have 2 or more records. If there is non or one record my macro is crushing.
I have something similar in several places in my code. I just need to have Id in column A from A2 going downn (1, 2, 3 etc) and none if no records are there.
Can You guys help me fix this?
my code
Code:
Dim LastRowFX As Integer
LastRowFX = ActiveSheet.Cells(Rows.Count, 2).End(xlUp).row
Cells(2, 1).Formula = "1"
Cells(2, 1).AutoFill Destination:=Range(Cells(2, 1), Cells(LastRowFX, 1)), Type:=xlFillSeries
Last edited: