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

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
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
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,215,724
Messages
6,126,477
Members
449,315
Latest member
misterzim

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