Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default indirect addressing? a range of cells

Is it possible using VBA to store an address string in a cell and then
assign a value to the cell whose address is stored? Or is there a better way
to solve this problem? Say I have a series of cells whose names might be
ap1,ap2,ap3...ad1,ad2,etc. I would then select the appropriate named cell
based on VBA code which first builds the address string ap1 or ad2, etc and
uses this string to assign a value (say 600 or 900) to the right cell (ap1 or
ad2, etc).

Thanks,
Randy
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default indirect addressing? a range of cells

Hi
do you mean

dim rstr as string
rstr="ap2"
range(rstr).value="Test"

--
Regards
Frank Kabel
Frankfurt, Germany

"spindle" schrieb im Newsbeitrag
...
Is it possible using VBA to store an address string in a cell and

then
assign a value to the cell whose address is stored? Or is there a

better way
to solve this problem? Say I have a series of cells whose names might

be
ap1,ap2,ap3...ad1,ad2,etc. I would then select the appropriate named

cell
based on VBA code which first builds the address string ap1 or ad2,

etc and
uses this string to assign a value (say 600 or 900) to the right cell

(ap1 or
ad2, etc).

Thanks,
Randy


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default indirect addressing? a range of cells

Here's a note of warning:
Don't use range names like "ad1" or "ap1" since these are actually cells:

Range("ad1") is the first cell in Col AD just to the right of range("ac1")
and just to the left of range("ae1").

If you try to name Range("B6") for example as "ad1", Excel will get confused.
"spindle" wrote:

Is it possible using VBA to store an address string in a cell and then
assign a value to the cell whose address is stored? Or is there a better way
to solve this problem? Say I have a series of cells whose names might be
ap1,ap2,ap3...ad1,ad2,etc. I would then select the appropriate named cell
based on VBA code which first builds the address string ap1 or ad2, etc and
uses this string to assign a value (say 600 or 900) to the right cell (ap1 or
ad2, etc).

Thanks,
Randy

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
Indirect addressing for linked file ChEBass Excel Worksheet Functions 5 December 11th 08 10:02 PM
Graphs using indirect addressing [email protected] Charts and Charting in Excel 3 January 2nd 08 05:37 PM
Indirect Addressing in VBA C Brandt Excel Discussion (Misc queries) 7 July 3rd 07 10:13 PM
Indirect Addressing Kanga 85 Excel Discussion (Misc queries) 3 December 5th 05 04:03 AM
Indirect addressing Tom Schroder Excel Programming 1 November 3rd 03 08:11 PM


All times are GMT +1. The time now is 04:21 AM.

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"