[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Quickie !  How to refer to a Name in VBA

Posted on 2011-02-16
6
Medium Priority
?
257 Views
Last Modified: 2012-05-11
Example: This is very easy ... if I explain it correctly!

I have a value "J" stored in cell A1. (This value will change!)
I then define a NAME so that cell A1 is named "Initial"

In VBA code I want to set strInitial =   the value in name "Initial"
See below.  

dim strInitial as string
    strInitial = ?????

What is the correct syntax so that strInitial will hold the value of "Initial"
0
Comment
Question by:Patrick O'Dea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 50

Accepted Solution

by:
Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 1332 total points
ID: 34911458
Hello,

Range.("initial")

cheers
0
 
LVL 50
ID: 34911467
Or, to complete your code lines

dim strInitial as string
    strInitial = Range.("Initial")
0
 
LVL 50

Assisted Solution

by:Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Ingeborg Hawighorst (Microsoft MVP / EE MVE) earned 1332 total points
ID: 34911483
Sorry, not quite awake yet. no dot!!

Dim strInitial As String
    strInitial = Range("Initial")
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 33

Assisted Solution

by:jppinto
jppinto earned 668 total points
ID: 34911508
0
 

Author Closing Comment

by:Patrick O'Dea
ID: 34911543
Thanks all.
I said it was a quickie!

I will check the links out jppinto
0
 
LVL 45

Expert Comment

by:patrickab
ID: 34911839
This is much simpler and will also work:

dim strInitial as string
strInitial = [Initial]

The [] square brackets just mean evaluate.

Patrick
0

Featured Post

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question