Select varying row to copy to another sheet

Hickmanyada

New Member
Joined
Apr 20, 2015
Messages
4
I need a macro to copy data from one sheet to another. In sheet 2 i need to copy data from the same row in a range between columns C to H. The row will change to be the bottom row with data in it.(can a formula be in the cell and it not be recognised by this if it is blank? or am I asking too much). I will then do a special paste, values only into sheet 1, C5 to H5.

help is much appreciated.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Perhaps

Code:
Sub test()

Dim lr As Integer

lr = Sheets("Sheet2").Cells(Rows.Count, "C").End(xlUp).Row

Sheets("Sheet1").Range("C5:H5").Value = _
Sheets("Sheet2").Range("C" & lr, "H" & lr).Value
 
End Sub
 
Upvote 0
Thank you, that worked at copying over the bottom line of data to where I wanted. I have formula input into the rows, is there anyway that it could ignore the rows with formula and go up to find cells with actual values. I tried blanking my formula but it still recognises it.
 
Upvote 0

Forum statistics

Threads
1,215,197
Messages
6,123,581
Members
449,108
Latest member
rache47

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
Back
Top