FryGirl
Well-known Member
- Joined
- Nov 11, 2008
- Messages
- 1,368
- Office Version
- 365
- 2016
- Platform
- Windows
I'm using a doubleclick event with the code below and all works well with the range of G2:G5.
At times the range could be longer, but not sure how to rearrange this to accomodate for say a range of G2:G10.
The range contains text.
At times the range could be longer, but not sure how to rearrange this to accomodate for say a range of G2:G10.
The range contains text.
Code:
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif] If Target.Address = "$H$6" Then
If Target.Value = Sheets(MyCtrlPanel).Range("G2") Then
Target.Value = Sheets(MyCtrlPanel).Range("G3")
ElseIf Target.Value = Sheets(MyCtrlPanel).Range("G3") Then
Target.Value = Sheets(MyCtrlPanel).Range("G4")
ElseIf Target.Value = Sheets(MyCtrlPanel).Range("G4") Then
Target.Value = Sheets(MyCtrlPanel).Range("G5")
ElseIf Target.Value = Sheets(MyCtrlPanel).Range("G5") Then
Target.Value = Sheets(MyCtrlPanel).Range("G2")
End If
End If
[/FONT]