T
Tim Coddington
Didn't get an answer last time. Perhaps my method of asking was wrong.
From Worksheet_Change I need to pop up a small form
to collect the Curr_User field and return the result to the caller.
Option Explicit
Public Curr_User As String
Private Sub Worksheet_Change(ByVal RangeChanged as Range)
If RangeChanged.Column = 2 and Curr_User = "" Then
Load frmRequestor
frmRequestor.Show
' Can't access the value here because cbxRequestor.value
' goes away as soon as frmRequestor.Hide executes.
Unload frmRequestor
End If
End Sub
frmRequestor only contains a combo-box to collect Curr_User
and a 'Done' command button. Now see the form code ...
Option Explicit
Private Sub Done_Click()
' Curr_User = cbxRequestor.Value 'Can't do this because
' as soon as
Done_Click()
' exits,
Curr_User goes
' out of scope.
' It was suggested that I do ActiveSheet.Range("A1").Value =
' frmRequestor.cbxRequestor.Value to conserve the value.
' Isn't there another way to declare a variable to save the value
' instead of using using a worksheet cell?
frmRequestor.Hide
End Sub
Thanks in advance,
-Tim
From Worksheet_Change I need to pop up a small form
to collect the Curr_User field and return the result to the caller.
Option Explicit
Public Curr_User As String
Private Sub Worksheet_Change(ByVal RangeChanged as Range)
If RangeChanged.Column = 2 and Curr_User = "" Then
Load frmRequestor
frmRequestor.Show
' Can't access the value here because cbxRequestor.value
' goes away as soon as frmRequestor.Hide executes.
Unload frmRequestor
End If
End Sub
frmRequestor only contains a combo-box to collect Curr_User
and a 'Done' command button. Now see the form code ...
Option Explicit
Private Sub Done_Click()
' Curr_User = cbxRequestor.Value 'Can't do this because
' as soon as
Done_Click()
' exits,
Curr_User goes
' out of scope.
' It was suggested that I do ActiveSheet.Range("A1").Value =
' frmRequestor.cbxRequestor.Value to conserve the value.
' Isn't there another way to declare a variable to save the value
' instead of using using a worksheet cell?
frmRequestor.Hide
End Sub
Thanks in advance,
-Tim