Using Cell name in vba: Newbie question

mtheriault2000

Well-known Member
Joined
Oct 23, 2008
Messages
826
Hello

Well not a true newbie, but i did not code in vba since a while and I'm stuck with a small problem. I got a blank and I'm a bit shy to ask :confused:

I got 2 worksheets
1: Data_IN_Out
2: Sheets2

In VBA, under the Sheets2 code, I want to use the value of a cell in sheet "Data_In_Out". I want to use is cell name ("iProposedQty")

Range("IproposedQTY").Value = 5 is referenced under the sheet("Data_In_Out") and I want to use it in a line of code under Sheets2

Hope I'm clear enough in my not so good English and programmer language

Martin
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Do you mean something like:
Code:
Sheets("Sheet2").Range("A1") = Range("IproposedQTY")
If your name has been defined as a global name within your workbook (usually default as) then this should work.
 
Upvote 0
Thanks JackDanIce
Thank al_b_cnu

JackDanIce,
Do you mean something like:

If your name has been defined as a global name within your workbook (usually default as) then this should work.

Hello JackDanIce


How to I define as a global name. I defined my names using Selection tool bar Formula,Created from selection. Then I want to use those created name in VBA. As I understand now, these created name are not global.
 
Upvote 0

Forum statistics

Threads
1,224,602
Messages
6,179,845
Members
452,948
Latest member
UsmanAli786

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