Copy to last line of data

keltic

New Member
Joined
Sep 3, 2002
Messages
20
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.

Thanks
keltic
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

mbb4331

Board Regular
Joined
Dec 22, 2005
Messages
152
Try:

Range("I6").select
Range(selection, selection.end(xldown)).select
 

keltic

New Member
Joined
Sep 3, 2002
Messages
20
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.

Regards
keltic
 

Forum statistics

Threads
1,141,592
Messages
5,707,287
Members
421,500
Latest member
Alex2302

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top