mtampa
Board Regular
- Joined
- Oct 15, 2007
- Messages
- 61
Hi guys,
Last week the board helped me figure out how to run a macro based on the selection from a combo box using the following code:
Sub Test_K3()
If Range("K3").Value = 3 Then Call FOC
If Range("K3").Value = 4 Then Call ExtParty
If Range("K3").Value = 2 Then Call Vacation
End Sub
I was able to get my macro FOC to run when the user selected choice 3 (a second combo box appears from a hidden area). However if the user tinkers with the form and happens to select option 4, then come back to option 3, my box continues its path across the screen.
I am trying to figure out the following order of operations:
1 - If the initial selection is option 3 then the box appears. (This I can do using the below macro:
Sub FOC()
'
' FOC Macro
' Macro recorded 10/11/2011 by tampami
'
'
Rows("28:79").Select
Selection.EntireRow.Hidden = False
Rows("12:28").Select
Selection.EntireRow.Hidden = True
ActiveSheet.Shapes("Drop Down 47").Select
Selection.ShapeRange.IncrementLeft -522#
Selection.ShapeRange.IncrementTop 3.75
Range("K2").Select
End Sub
2 - If the choice is changed to choice 2 or 4, the box returns to its original position (This I can do with a macro called "return_box" ...see below:
Sub RETURN_BOX()
'
' RETURN_BOX Macro
' Macro recorded 10/18/2011 by tampami
'
'
ActiveSheet.Shapes("Drop Down 47").Select
Selection.ShapeRange.IncrementLeft 522#
Selection.ShapeRange.IncrementTop -3#
Range("K2").Select
End Sub
3 - However, if choice 2 or 4 is chosen initially, I do not want the macro "return_box" to trigger.
In summary, I want "return_box" to run ONLY if choice 3 was selected initially.
How in the world would this be programmed?
Thanks!
Last week the board helped me figure out how to run a macro based on the selection from a combo box using the following code:
Sub Test_K3()
If Range("K3").Value = 3 Then Call FOC
If Range("K3").Value = 4 Then Call ExtParty
If Range("K3").Value = 2 Then Call Vacation
End Sub
I was able to get my macro FOC to run when the user selected choice 3 (a second combo box appears from a hidden area). However if the user tinkers with the form and happens to select option 4, then come back to option 3, my box continues its path across the screen.
I am trying to figure out the following order of operations:
1 - If the initial selection is option 3 then the box appears. (This I can do using the below macro:
Sub FOC()
'
' FOC Macro
' Macro recorded 10/11/2011 by tampami
'
'
Rows("28:79").Select
Selection.EntireRow.Hidden = False
Rows("12:28").Select
Selection.EntireRow.Hidden = True
ActiveSheet.Shapes("Drop Down 47").Select
Selection.ShapeRange.IncrementLeft -522#
Selection.ShapeRange.IncrementTop 3.75
Range("K2").Select
End Sub
2 - If the choice is changed to choice 2 or 4, the box returns to its original position (This I can do with a macro called "return_box" ...see below:
Sub RETURN_BOX()
'
' RETURN_BOX Macro
' Macro recorded 10/18/2011 by tampami
'
'
ActiveSheet.Shapes("Drop Down 47").Select
Selection.ShapeRange.IncrementLeft 522#
Selection.ShapeRange.IncrementTop -3#
Range("K2").Select
End Sub
3 - However, if choice 2 or 4 is chosen initially, I do not want the macro "return_box" to trigger.
In summary, I want "return_box" to run ONLY if choice 3 was selected initially.
How in the world would this be programmed?
Thanks!