LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default how do I link a constant or variable to form

c1802362 explained on 9/13/2011 :
Thanks - it works, although I was hoping to avoid the intermediate
step of writing the filename to a cell before transferring it to the
form. Right now the file name is a string constant at the head of the
VBA code, but I have a hidden sheet full of info I used per your
directions


Ok, you could have just used the declared constant instead of the cell
text. I didn't know you already had this in place (and so IS WHY I
asked you to define the posted variables). According to your
explanation, the filename is stored in a cell where users can update it
when the filename changes. Not sure why you ALSO hard code it as a
CONSTant in code since it's data is variable!


By the way, I had to modify your syntax to:
form1.lblDataSource.Caption = Range("DataSource").Text
to get an object reference


This would not be necessary had you put this line of code in the
Userform_Initialize event as I instructed you to do. This way, you
don't need to ref the userform because it knows itself and all the
controls on it.

--
Garry

Free usenet access at http://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc



--- Posted via news://freenews.netfront.net/ - Complaints to ---


 
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
Getting a constant/variable from another workbook? Gustaf Excel Programming 6 May 25th 09 01:07 PM
From variable to excel constant Carmen Excel Programming 2 December 6th 07 03:07 AM
Removing the constant link from Spinner [email protected] Excel Worksheet Functions 1 September 1st 07 02:22 AM
Variable Acting Like a Constant? George Boynton Excel Programming 2 October 14th 05 04:06 PM
Is it possible to open the VBA form with a link in a sheet and to pass variable from a cell to the VBA form? Daniel[_14_] Excel Programming 1 August 29th 04 01:20 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"