Any idea why this is giving me a run time error 6: Overflow?
Sheets("Raw data").Select
Dim lastrow2 As Integer
Dim lastcol2 As Integer
lastcol2 = Cells(1, Columns.Count).End(xlToLeft).Column
lastrow2 = Cells(Rows.Count, 1).End(xlUp).Row
Range(Cells(1, 1), Cells(lastrow2, lastcol2)).Name = "RawData"
I've used the exact same vbs code on a different sheet and it runs fine. All I've done is renamed the variables as lastrow2 and lastcol2. It's the lastrow2 line that's giving me problems I think.