Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a button on a userform. The userform is displayed after pressing a button on a worksheet, called from a peice of code. UserForm1.Show Upon pressing the button a value is set (eg x = 1). How do I pass the value for x back to the original code? I have tried using 'Public x as Variant'. -- Andrew |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
use
Public x as Variant in a general module - the type you get if you do Insert=Module then it is visible to the entire project. -- Regards, Tom Ogilvy "Andrew" wrote in message ... Hi, I have a button on a userform. The userform is displayed after pressing a button on a worksheet, called from a peice of code. UserForm1.Show Upon pressing the button a value is set (eg x = 1). How do I pass the value for x back to the original code? I have tried using 'Public x as Variant'. -- Andrew |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tom,
I've tried putting that statement in both the module and code on the form. I have a watch on 'x' and when the code goes back to the module code the watch value goes to '<out of context' -- Andrew "Tom Ogilvy" wrote: use Public x as Variant in a general module - the type you get if you do Insert=Module then it is visible to the entire project. -- Regards, Tom Ogilvy "Andrew" wrote in message ... Hi, I have a button on a userform. The userform is displayed after pressing a button on a worksheet, called from a peice of code. UserForm1.Show Upon pressing the button a value is set (eg x = 1). How do I pass the value for x back to the original code? I have tried using 'Public x as Variant'. -- Andrew |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well, I didn't say anything about putting it (the declaration) in the code
on the form. That just defeats the whole purpose. -- Regards, Tom Ogilvy "Andrew" wrote in message ... Hi Tom, I've tried putting that statement in both the module and code on the form. I have a watch on 'x' and when the code goes back to the module code the watch value goes to '<out of context' -- Andrew "Tom Ogilvy" wrote: use Public x as Variant in a general module - the type you get if you do Insert=Module then it is visible to the entire project. -- Regards, Tom Ogilvy "Andrew" wrote in message ... Hi, I have a button on a userform. The userform is displayed after pressing a button on a worksheet, called from a peice of code. UserForm1.Show Upon pressing the button a value is set (eg x = 1). How do I pass the value for x back to the original code? I have tried using 'Public x as Variant'. -- Andrew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Variant | Excel Programming | |||
using find with variant? | Excel Programming | |||
Passing variant arrays to C/C++ dll's | Excel Programming | |||
Variant as matrix | Excel Programming | |||
Variant Array | Excel Programming |