Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default problems with a userform

Hi, I have a userform with 2 textboxes:

Private Sub CommandButton1_Click()

a=textbox1
b=textbox2
macro1 'execute the macro1
end
end sub

sub Macro1()
msgbox a,vbokonly,b
end sub

my problem is that when the userform lost focus the variables lost their
value, I mean, when macro1 is called a and b appears as a=empty and b=empty
and I want the values od textbox1 and textbox2

How to savfe the variables so they are available using the macro1 ???

Aldo I would like to know information about deffining variables that save
his value in all the program and also variables that save his value althougt
the program is close and open again

TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default problems with a userform

Tank you , could you chek the disscution about :
"problems with a formulas" 3 lines at bottom from this one

Tanks
"David Hepner" wrote:

Declare a & b as public variables at the top of your code (before Private Sub
CommandButton1_Click)

Public a As String
Public b As String



"filo666" wrote:

Hi, I have a userform with 2 textboxes:

Private Sub CommandButton1_Click()

a=textbox1
b=textbox2
macro1 'execute the macro1
end
end sub

sub Macro1()
msgbox a,vbokonly,b
end sub

my problem is that when the userform lost focus the variables lost their
value, I mean, when macro1 is called a and b appears as a=empty and b=empty
and I want the values od textbox1 and textbox2

How to savfe the variables so they are available using the macro1 ???

Aldo I would like to know information about deffining variables that save
his value in all the program and also variables that save his value althougt
the program is close and open again

TIA

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
problems with a userform sebastienm Excel Programming 0 September 7th 05 01:11 AM
userform problems [email protected] Excel Programming 0 March 7th 05 08:56 PM
userform problems [email protected] Excel Programming 0 February 16th 05 07:01 PM
userform problems [email protected] Excel Programming 0 February 16th 05 06:10 PM
UserForm Problems Joe[_27_] Excel Programming 2 October 21st 03 12:52 PM


All times are GMT +1. The time now is 09:12 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"