#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Exit Event

The code below cause the contents of TextBox 80 to be placed onto the
worksheet when I exit the cell and it works fine if I Tab out of the cell or
click another TextBox on the same page of my MultiPage control.

My problem is, if the user clicks on the next page of the MultiPage control,
Excel does not recognize it as an exit event. So the value is not placed on
the worksheet. Any ideas?



Private Sub TextBox80_Exit(ByVal Cancel As MSForms.ReturnBoolean)

If TextBox80.Value "" Then
Worksheets("Income").Range("B3").Formula = "=" & TextBox80.Value

Else

Worksheets("Income").Range("B3").Formula = TextBox80.Value

End If

Call Initialization.Initialization

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Exit Event


Add a Change-event to your MultiPage.
The .Value property represents the chosen page, so:

Private Sub YourMultiPage_Change()
If MultiPage.Value = 0 Then 'First Page
'TextBox handling here
End If
End Sub




"Patrick Simonds" schreef in bericht
...
The code below cause the contents of TextBox 80 to be placed onto the
worksheet when I exit the cell and it works fine if I Tab out of the cell
or click another TextBox on the same page of my MultiPage control.

My problem is, if the user clicks on the next page of the MultiPage
control, Excel does not recognize it as an exit event. So the value is not
placed on the worksheet. Any ideas?



Private Sub TextBox80_Exit(ByVal Cancel As MSForms.ReturnBoolean)

If TextBox80.Value "" Then
Worksheets("Income").Range("B3").Formula = "=" & TextBox80.Value

Else

Worksheets("Income").Range("B3").Formula = TextBox80.Value

End If

Call Initialization.Initialization

End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Exit Event

I tried many variants of your suggestion but was not able to get more than
the first page to update when I clicked to another page. The MultiPage
control has 6 pages (January, February, March, April, May, June). This is
where I am now, but again it only works when I click from January to any of
the other pages.


Private Sub MultiPage2_Change()

If MultiPage2.Value = 0 Then
PopulateWorksheets.PopulateWorksheets

ElseIf MultiPage2.Value = 1 Then
PopulateWorksheets.PopulateWorksheets

ElseIf MultiPage2.Value = 2 Then
PopulateWorksheets.PopulateWorksheets

ElseIf MultiPage2.Value = 3 Then
PopulateWorksheets.PopulateWorksheets

ElseIf MultiPage2.Value = 4 Then
PopulateWorksheets.PopulateWorksheets

ElseIf MultiPage2.Value = 5 Then
PopulateWorksheets.PopulateWorksheets

End If

End Sub


"moon" wrote in message
. ..

Add a Change-event to your MultiPage.
The .Value property represents the chosen page, so:

Private Sub YourMultiPage_Change()
If MultiPage.Value = 0 Then 'First Page
'TextBox handling here
End If
End Sub




"Patrick Simonds" schreef in bericht
...
The code below cause the contents of TextBox 80 to be placed onto the
worksheet when I exit the cell and it works fine if I Tab out of the cell
or click another TextBox on the same page of my MultiPage control.

My problem is, if the user clicks on the next page of the MultiPage
control, Excel does not recognize it as an exit event. So the value is
not placed on the worksheet. Any ideas?



Private Sub TextBox80_Exit(ByVal Cancel As MSForms.ReturnBoolean)

If TextBox80.Value "" Then
Worksheets("Income").Range("B3").Formula = "=" & TextBox80.Value

Else

Worksheets("Income").Range("B3").Formula = TextBox80.Value

End If

Call Initialization.Initialization

End Sub





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
exit event John Pierce Excel Programming 3 February 2nd 06 01:00 AM
Need some help with Exit Event Matt[_31_] Excel Programming 4 April 1st 05 12:22 AM
How To Get An Event To Run When I Exit A TextBox Minitman[_4_] Excel Programming 7 October 22nd 04 11:27 PM
combobox exit event Dave D[_3_] Excel Programming 0 April 28th 04 10:22 PM
Exit Event Michael J. Malinsky Excel Programming 1 February 27th 04 06:40 PM


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