PC Review


Reply
Thread Tools Rate Thread

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

 
 
Denis Lory
Guest
Posts: n/a
 
      11th Apr 2008
Hi Guys.

A Workbook containing 3 sheets.
Using the formula Range("A12").Select, can the data "A1" and "D2"
inside the formula be substituted with the contents of another cell?
For example:
Using the formula Range("A12").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 With Quote
 
 
 
 
UKNewbie
Guest
Posts: n/a
 
      11th Apr 2008
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("A12").Select, can the data "A1" and "D2"
> inside the formula be substituted with the contents of another cell?
> For example:
> Using the formula Range("A12").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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete contents of cells in a range based on value of a cell Michael Lanier Microsoft Excel Programming 2 25th Apr 2010 06:51 PM
Macro to clear range contents when cell contents are changed by us =?Utf-8?B?U3RldmUgRQ==?= Microsoft Excel Programming 12 22nd Feb 2007 09:09 PM
how do i create a macro that would check the contents of cells =?Utf-8?B?SmFkZQ==?= Microsoft Excel Misc 1 31st Dec 2005 01:37 AM
how do i create a macro that would check the contents of cells =?Utf-8?B?SmFkZQ==?= Microsoft Excel Misc 1 31st Dec 2005 12:48 AM
Adding contents of one cell to a range of cells. =?Utf-8?B?Q0xKaW5WQQ==?= Microsoft Excel Worksheet Functions 1 10th Feb 2005 10:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:30 AM.