Create a Macro to Range Cells, from the contents of another Cell.

D

Denis Lory

Hi Guys.

A Workbook containing 3 sheets.
Using the formula Range("A1:D2").Select, can the data "A1" and "D2"
inside the formula be substituted with the contents of another cell?
For example:
Using the formula Range("A1:D2").Select to select data from sheet 1,
replace "A1" & "D2" from the cell "J4" & "K4" in sheet 2, which has the
correct ranges, and then the result pasted in sheet 3.
Sheet 2 has the data ranges required, and they change frequently.
Is this possible? Can an automation be done to range formulas with
information from another cell?

Any help is much appreciated.
Denis
 
U

UKNewbie

Hi Denis,

You can use a value on Sheet2 in your range. Simply reference the cell
explicitly or assign the cells value to a variable e.g

Sheet1.Range(Sheet2.Cells(1,1).Text).Select

or

myRange=Sheet2.Cells(1,1).Text
Sheet1.Range(myRange).Select

Sheet1 would need to be the active sheet.

Hope this helps,

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top