I have a spreadsheet with data in columns A through to G.
The data starts on row 6 in column A, which is populated to the last line with a name. Columns B to G may or may not contain a value. The data always starts on row 6.
I am trying to copy formulae from a worksheet named control to I6:to the last line of data in column A (ie line 268 as in the following code).
Sheets("Control").Select
Range("I5:L5").Select
Selection.Copy
Sheets("Sheet4").Select
Range("I6:I268").Select
ActiveSheet.Paste
Application.CutCopyMode = False
End Sub
The problem is the information in column A may vary on a monthly basis, so row I268 may be lower or higher. I assume I may be able to use some sort of offset command or lastrow command but can't quite get my head around which would be best.
Any help would be appreciated.
Try:
Range("I6").select
Range(selection, selection.end(xldown)).select
That copies down to row 65536. I am trying to find the last data entry in column A eg row 252 or row 235 or row 278 and copy the formula to this row.
As per my quote above, if there is data in column A from row 6 to 252 I need to copy a formula from I6:I252. Similarly, if the data changes next month in column A from row 6 to 235, I need to copy the formula from I6:I235.
Anyone else out there help ?
Thanks
Regards
Keltic