Need to specify a range using cells reference

Bill_Biggs

Well-known Member
Joined
Feb 6, 2007
Messages
1,216
I need a line of code to specify a cell range where the cells constantly change values.

Psuedocode:

Range ((Cells(A,B)) : ((Cells (C,D)).Select

I can't seem to find the correct way of writing this. Any takers?

Thank you,
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Like this

Code:
Range(Sheets("Sheet1").Cells(1, 2), Sheets("Sheet1").Cells(5, 4)).Select

You can omit the sheet qualifier if you are referring to the active sheet.
 
Upvote 0

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
Example:

Code:
Sub Test()
    Const A = 1
    Const B = 2
    Const C = 10
    Const D = 4
    Range(Cells(A, B), Cells(C, D)).Select
End Sub
 
Upvote 0

Forum statistics

Threads
1,191,124
Messages
5,984,782
Members
439,910
Latest member
Flyingjoblo

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