Ranges and Cells

ShuStar

Board Regular
Joined
Sep 9, 2015
Messages
89
Office Version
  1. 2010
Platform
  1. Windows
Hi all,

Stuck here, hoping someone can help. I am trying to define range as below (once i have defined this range, the next code would be to copy this range and then paste it in another sheet which I should be able to do...)

Bit I am stuck on is on how to define the range:
-the Start Range is always "D3"
-The End Range is the value in cell A1 (which is 23 - but can change)
-So effectively I would like the code to say: select range D3:DX as the value can change in A1. I am stuck on how this range should be defined. I have tried Offset but hasn't helped.

Current code looks like below, but i think I am over complicating it. I know providing an extract is usually helpful to the Guru's, but unfortunately i am not able to do this.

SubCopyandPasteList()
Dim startcell As Range
Dim endcell As Range
Set startcell = Range("D3")
'Set endcell = Range("B2").Value
endcell.Value = Range("A1")

Sheets("List").Select
Range("D3").Select
' ActiveSheet.Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column)).Select
Selection.End(xlDown).Select
Selection.End(xlUp).Offset(1).Select

End


What should the macro look like? If anyone can help that would be great.. i have tried all sorts and no avail :(

Thanks all.
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
If the value in A1 is 23 then this:
Range("D3:D" & Range("A1").Value)
is the range D3:D23.
 
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,047
Members
448,940
Latest member
mdusw

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