Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Access a Variable from the Worksheet

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Access a Variable from the Worksheet

Activeworkbook.Names.Add Name:="msge", RefersTo:="Hello World"

--
__________________________________
HTH

Bob

"Gary''s Student" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Access a Variable from the Worksheet

PERFECT!
--
Gary''s Student - gsnu200800


"Bob Phillips" wrote:

Activeworkbook.Names.Add Name:="msge", RefersTo:="Hello World"

--
__________________________________
HTH

Bob

"Gary''s Student" wrote in message
...
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
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
Access a VBA global variable/constant from a worksheet cell Lina Excel Programming 2 July 29th 08 07:46 PM
Access variable from form and module? parkin_m Excel Programming 1 August 8th 07 03:32 PM
Access to Variable C Brandt Excel Discussion (Misc queries) 1 June 5th 07 05:19 PM
Passing variable to Access Job Excel Programming 4 July 6th 05 03:52 PM
I Need VBA Assistance regarding passing a variable from Access Brent E Excel Programming 1 March 1st 05 08:16 PM


All times are GMT +1. The time now is 02:10 PM.

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"