Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am trying to capture a variant using a TextBox for use later on in seperate Macro. The first part of the macro works fine and captures th data I require but it seems to lose the variable later on. I use a Form with 3 TextBoxes to capture 3 dates - date1, date2, date3 Upon clicking the OK button (CommandButton1) the contents of th textboxes are "transfered" to variables date1, date2, date3 - as see below. Public Sub CommandButton1_Click() Dim date1, date2, date3 As Variant date1 = TextBox1 date2 = TextBox2 date3 = TextBox3 Unload UserForm1 End Sub Then I wish to run the following code to return these dates vi keypresses no data is returned. Sub Fkeyson() Application.OnKey "{F10}", "doDate1" Application.OnKey "{F11}", "doDate2" Application.OnKey "{F12}", "doDate3" End Sub Sub Fkeysoff() Application.OnKey "{F10}" Application.OnKey "{F11}" Application.OnKey "{F12}" End Sub Sub doDate1() MsgBox (date1) ActiveCell.Value = date1 End Sub What do I need to do to carry the variables over from one macro t another ? Thanks in advance -- SeanEvan ----------------------------------------------------------------------- SeanEvans's Profile: http://www.excelforum.com/member.php...fo&userid=1465 View this thread: http://www.excelforum.com/showthread.php?threadid=26385 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Not at all clear on use of variables and/or object variables | Excel Discussion (Misc queries) | |||
Textboxes | Excel Discussion (Misc queries) | |||
tab between several textboxes | Excel Worksheet Functions | |||
Textboxes | Excel Programming | |||
textboxes | Excel Programming |