Using a value within cell as range in macro (Sorry to ask ag

Jazzmanstereo

New Member
Joined
Apr 8, 2002
Messages
10
Alright. A simple version of what i want is this...

I have a value (money) in cell A1 and i want it to be added to cell A2. The thing is i want the macro to look at the value in B1 (which is A2) to direct it to A2.

This is a simplified version of what i want but if you could explain it to me using this it would realy realy help a lot.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
The following formula will work:

=A1+INDIRECT(B1)

It isn't VB though. This formula adds A1 to the A2 if the text "A2" is in cell B1.
 
Upvote 0
thanks, but what i need is for it to run through a macro. Its for an order form you see. And when an order is processed i intend to add this so that it will add a value to another when the order is processed.

if anyone can help further... please do!
 
Upvote 0
This piece of takes the value of A1 and places it in the cell that is written in B1

Sub test200()
Range([b1].Text).Value = range([b1].test).value+ [a1].Value
End Sub

regards Tommy
This message was edited by Tommy Bak on 2002-04-09 06:55
 
Upvote 0
Hi there

Try this bit of code:

Range(Range("B1").Value).Value =Range(Range("B1").Value).Value + Range("A1").Value

regards
Derek
 
Upvote 0
ok, thanks guys. this is a great board. i think i have it solved. if not, i will be back. but THANKS to everyone who replied an helped out.

No doubt i will be back soon.
 
Upvote 0

Forum statistics

Threads
1,213,494
Messages
6,113,981
Members
448,538
Latest member
alex78

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