View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
[email protected] MiataDiablo@gmail.com is offline
external usenet poster
 
Posts: 31
Default Userform causing a slip for Worksheet activate?

On Sep 12, 1:39*am, Joel wrote:
It is working for me but I had to comment out lines below because I didn't
have these objects

' * * * * Call AddMinBox
* * * * * * *If ActiveSheet.Name = "Real Estate Index" Then
*' * * * cmdBldgTab.Visible = True
*' * * * togEditParty.Visible = True
*' * * * cmdRealEstateTab.Visible = False

Try commenting out the same lines and see if it works. *It may be something
in the AddMinBox routing that is causing the problem.



" wrote:
I have a userform that works perfectly the first time it's used, but
the Worksheet Activate for the worksheet(s) isn't firing when the
command button on the userform is used to return the user to the
previous worksheet - regardless of which worksheet they chose first.
Should I use atogglebutton instead? *I don't know how to code a
togglebutton totogglebetween two worksheets. *Should I have
something in Deactivate for the Userform? *Am I completely off
target?


REAL ESTATE INDEX WORKSHEET
* *Private Sub Worksheet_Activate()
* * * * BuildingsForm.Show vbModeless
* * * * Application.ErrorCheckingOptions.BackgroundCheckin g = False
* * * * * * *With ActiveSheet
* * * * * *If .Columns("d:e").Hidden = False Then
* * * * * * * * .Columns("d:e").Hidden = True
* * * * * * * * .Columns("f:f").Hidden = False
* * * * * * * * * End If
* * * * * * * End With


* *End Sub


USERFORM
* *Private Sub UserForm_Activate()
* * * * Call AddMinBox
* * * * * * If ActiveSheet.Name = "Real Estate Index" Then
* * * * * *cmdBldgTab.Visible = True
* * * * * *togEditParty.Visible = True
* * * * * *cmdRealEstateTab.Visible = False
* * * * * * End If


* * * * * * *If ActiveSheet.Name = "Buildings" Then
* * * * * *cmdBldgTab.Visible = False
* * * * * *togEditParty.Visible = False
* * * * * *cmdRealEstateTab.Visible = True
* * * * * * *End If
* *End Sub


COMMAND BUTTONS
* *Private Sub cmdBldgTab_Click()
* *'Visible when Real Estate Index worksheet is active
* * * * * Sheets("Buildings").Select
* * * * * Range("A1").Select
* *End Sub


* *Private Sub cmdRealEstateTab_Click()
* *'Visible when Buildings worksheet is active
* * * * * Sheets("Real Estate Index").Select
* * * * * Range("B1").Select
* *End Sub- Hide quoted text -


- Show quoted text -


I still can't get it to work. I've even run the Clean Project code
stripper on it. As much as I hate to, I think I'm going to resort
back to having separate user forms on the two worksheets. Groan.
Thanks for taking a look though.