PC Review


Reply
Thread Tools Rate Thread

Access a Variable from the Worksheet

 
 
Gary''s Student
Guest
Posts: n/a
 
      14th Aug 2008
Is there anyway to link the value of a public variable in a module to a Name
in the worksheet?

For example:

Public mesge As String
Sub anything()
mesge = "Hello World"
End Sub

and then somehow define a Name of the worksheet so that:
=mesge
would display:
Hello World
--
Gary''s Student - gsnu200800
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      14th Aug 2008
Activeworkbook.Names.Add Name:="msge", RefersTo:="Hello World"

--
__________________________________
HTH

Bob

"Gary''s Student" <(E-Mail Removed)> wrote in message
news801BE48-E48F-4C6A-89C9-(E-Mail Removed)...
> Is there anyway to link the value of a public variable in a module to a
> Name
> in the worksheet?
>
> For example:
>
> Public mesge As String
> Sub anything()
> mesge = "Hello World"
> End Sub
>
> and then somehow define a Name of the worksheet so that:
> =mesge
> would display:
> Hello World
> --
> Gary''s Student - gsnu200800



 
Reply With Quote
 
Gary''s Student
Guest
Posts: n/a
 
      14th Aug 2008
PERFECT!
--
Gary''s Student - gsnu200800


"Bob Phillips" wrote:

> Activeworkbook.Names.Add Name:="msge", RefersTo:="Hello World"
>
> --
> __________________________________
> HTH
>
> Bob
>
> "Gary''s Student" <(E-Mail Removed)> wrote in message
> news801BE48-E48F-4C6A-89C9-(E-Mail Removed)...
> > Is there anyway to link the value of a public variable in a module to a
> > Name
> > in the worksheet?
> >
> > For example:
> >
> > Public mesge As String
> > Sub anything()
> > mesge = "Hello World"
> > End Sub
> >
> > and then somehow define a Name of the worksheet so that:
> > =mesge
> > would display:
> > Hello World
> > --
> > Gary''s Student - gsnu200800

>
>
>

 
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
How to access VBA variable from active worksheet Andrew Microsoft Excel Programming 1 23rd May 2009 09:50 AM
Access a VBA global variable/constant from a worksheet cell Lina Microsoft Excel Programming 1 29th Jul 2008 07:46 PM
Link variable data from one worksheet to another worksheet? T MAT Microsoft Excel New Users 3 27th Nov 2007 06:46 AM
Re: Variable worksheet name (tab) linked to cell in same worksheet Don Guillett Microsoft Excel Worksheet Functions 4 9th Jan 2007 08:37 PM
Looking up a variable in one worksheet and copying information from another column to another worksheet?? Brad Torken Microsoft Excel Misc 2 10th Dec 2006 06:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:41 PM.