PDA

View Full Version : userform menu problem



shivam
01-23-2017, 10:14 PM
open the excel file & click on the home command button the userform popup & move the mouse to company info the company info fram was display & click on the create company the create company userform was display.......please resolve this vba code problum
thanking you

Logit
01-28-2017, 01:52 PM
.
To prevent any menu item from disappearing when the mouse moves over it ... look in the code ( FrmMainMenu ) for Frame2.Visible = False


The Frame # will vary depending on which frame you are looking at. It could be Frame1.Visible = False ... or Frame3.Visible = False, etc.

Change FALSE to True and the frame will always be visible when the mouse moves over it.



To add code to each menu selection on the Form, in the VBE display the form, then double click on the specific menu selection you want to add code
to. The window will open to the code editor with the beginnings of a Sub that is empty, into which you can add your code.

An example when double clicking on CREATE COMPANY :



Private Sub Label7_Click()

'add your code here

End Sub


Also, you need to add the following line (Dim a As Integer) in this sub:



Private Sub Frame2_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal x As Single, ByVal Y As Single)

Dim a As Integer '<--- this line !

For a = 4 To 10
Controls("label" & a).BackColor = &H8000000F
Controls("label" & a).ForeColor = &H80000006
Next
End Sub

shivam
02-01-2017, 02:35 AM
please add the vba code to my attached excel sheet end send this to me sir

Logit
02-01-2017, 07:50 AM
shivam:


please add the vba code to my attached excel sheet end send this to me sir

That is not how this works. You ask the question, you receive assistance and then you learn from that assistance. Having someone else program for you accomplishes very little
because you don't learn from the experience.

The instructions on what to do and how to do it are listed in my post #2.

You'll be more satisfied having accomplished this on your own.

Best wishes !