Good Afternoon guys
I have a macro that takes a file from a folder, formats it, and then locks and saves it. It pulls 4 different excel CSV files from one folder. The macro worked fine until I tried to implement the last two of the four. It is giving me run time error '1004' and saying "AutoFill method of Range class failed".
Range("E1").Select
ActiveCell.Formula = "AD Group"
If Range("A1").Value = "" Then
Else
Range("E2").Select
ActiveCell.Formula = "a-RRAxx-KYCHighRiskOffshoreRW"
Dim lastrowOffshoreRW As Long
lastrowOffshoreRW = Cells(Rows.Count, 1).End(xlUp).Row
Selection.AutoFill Destination:=Range("E2:E" & lastrowOffshoreRW)
The program seems to stop running whenever there is only one entry in the CSV file. If you add another entry it works fine. Any suggestions?
Thanks
I have a macro that takes a file from a folder, formats it, and then locks and saves it. It pulls 4 different excel CSV files from one folder. The macro worked fine until I tried to implement the last two of the four. It is giving me run time error '1004' and saying "AutoFill method of Range class failed".
Range("E1").Select
ActiveCell.Formula = "AD Group"
If Range("A1").Value = "" Then
Else
Range("E2").Select
ActiveCell.Formula = "a-RRAxx-KYCHighRiskOffshoreRW"
Dim lastrowOffshoreRW As Long
lastrowOffshoreRW = Cells(Rows.Count, 1).End(xlUp).Row
Selection.AutoFill Destination:=Range("E2:E" & lastrowOffshoreRW)
The program seems to stop running whenever there is only one entry in the CSV file. If you add another entry it works fine. Any suggestions?
Thanks