Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Create a Macro to Range Cells, from the contents of another Cell.

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


*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Create a Macro to Range Cells, from the contents of another Cell.

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

"Denis Lory" wrote:

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


*** Sent via Developersdex http://www.developersdex.com ***

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to clear range contents when cell contents are changed by us Steve E Excel Programming 12 February 22nd 07 09:09 PM
Create a macro to run autofilter based on contents of 2 cells Syndrome Excel Programming 3 September 16th 06 10:33 AM
how do i create a macro that would check the contents of cells Jade Excel Discussion (Misc queries) 1 December 31st 05 01:37 AM
how do i create a macro that would check the contents of cells Jade Excel Discussion (Misc queries) 1 December 31st 05 12:48 AM
Adding contents of one cell to a range of cells. CLJinVA Excel Worksheet Functions 1 February 10th 05 10:19 PM


All times are GMT +1. The time now is 07:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"