Range paste code ??

kl2190

New Member
Joined
Oct 28, 2010
Messages
15
hi all,

how do i specify the range between that last used cell+1 in column C and the last used row on the sheet and all the cells in between. example if C5 is the last used cell in column C and row 8 is the last used row on the sheet. it will paste to C6,C7,C8. i cant get the destination right.


LastRowSL = Worksheets("Saw List").UsedRange.Rows.Count
LastCell = Worksheets("Saw List").Cells(Rows.Count, "C").End(xlUp).Row Worksheets("Windows").Range("E2").Copy _
Destination:=Worksheets("Saw List").Range("C" & LastCell + 1 & ":C" & LastRowSL)
<!-- / message -->
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
try setting your range before your copy paste code

Code:
dim lastRowSL as long, lastCell as long, rngDest as range
 
LastRowSL = Worksheets("Saw List").UsedRange.Rows.Count
LastCell = Worksheets("Saw List").Cells(Rows.Count, "C").End(xlUp).Row 
 
with Worksheets("Saw List")
    set rngDest = .range(.cells(lastcell,3),.cells(lastrowSL,3))
end with
 
Worksheets("Windows").Range("E2").Copy Destination:= rngDest
 
Upvote 0

Forum statistics

Threads
1,224,566
Messages
6,179,551
Members
452,927
Latest member
rows and columns

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