Jim Milligan
New Member
- Joined
- Feb 1, 2019
- Messages
- 2
Hi All,
I wonder if youcan help me out with what I suspect is a simple piece of coding which I cannotfigure out.
The code belowis on a button on a UserForm on a worksheet that I call ‘Control’.
It allows me tomake a selection from a populated ListBox on the same form and works wellenough, but with a problem.
The code carriesme to the selected sheet, but then the UserForm sits in front of it and stops me accessingthe sheet. If I close the UserForm manually I am carried back to the ‘Control’sheet.
What I’d liketo be able to do is click the button, go to the selected sheet without theUserForm being there, and use the sheet’s ‘Show’ and ‘Clear’ buttons to work onthe sheet. On completion I’d like to use a ‘Return’ button on the selectedsheet to go back to the ‘Control’ and UserForm sheet to make another selection.
Your advicewould be appreciated
Best regards
Jim
**************************************************************************************
Private SubCommandButton1_Click() ' Selects sheet to practice chord
' WORKING - BUT NEEDS ATTENTION TO [FONT="Arial",sans-serif]BE[SIZE=2]HAVIOUR OF USERFORM[/SIZE][/FONT][/COLOR]
[COLOR=#008000][SIZE=2][/SIZE][/COLOR][COLOR=#008000][SIZE=2][FONT="Arial"] ' i.e. HOW TO MAKE IT DISAPPEARBUT STILL STAY[/FONT][/SIZE] ON SELECTED SHEET,
' AND ALLOWACCESS TO SHOW, CLEAR etc BUTTONS.
Select CaseListBox1.ListIndex
Case "-1"
MsgBox "No Chord Selected"
Case "0"
Sheets("A").Select
Case "1"
Sheets("D").Select
Case "2"
Sheets("E").Select
Case "3"
Sheets("G").Select
End Select
End Sub
I wonder if youcan help me out with what I suspect is a simple piece of coding which I cannotfigure out.
The code belowis on a button on a UserForm on a worksheet that I call ‘Control’.
It allows me tomake a selection from a populated ListBox on the same form and works wellenough, but with a problem.
The code carriesme to the selected sheet, but then the UserForm sits in front of it and stops me accessingthe sheet. If I close the UserForm manually I am carried back to the ‘Control’sheet.
What I’d liketo be able to do is click the button, go to the selected sheet without theUserForm being there, and use the sheet’s ‘Show’ and ‘Clear’ buttons to work onthe sheet. On completion I’d like to use a ‘Return’ button on the selectedsheet to go back to the ‘Control’ and UserForm sheet to make another selection.
Your advicewould be appreciated
Best regards
Jim
**************************************************************************************
Private SubCommandButton1_Click() ' Selects sheet to practice chord
' WORKING - BUT NEEDS ATTENTION TO [FONT="Arial",sans-serif]BE[SIZE=2]HAVIOUR OF USERFORM[/SIZE][/FONT][/COLOR]
[COLOR=#008000][SIZE=2][/SIZE][/COLOR][COLOR=#008000][SIZE=2][FONT="Arial"] ' i.e. HOW TO MAKE IT DISAPPEARBUT STILL STAY[/FONT][/SIZE] ON SELECTED SHEET,
' AND ALLOWACCESS TO SHOW, CLEAR etc BUTTONS.
Select CaseListBox1.ListIndex
Case "-1"
MsgBox "No Chord Selected"
Case "0"
Sheets("A").Select
Case "1"
Sheets("D").Select
Case "2"
Sheets("E").Select
Case "3"
Sheets("G").Select
End Select
End Sub