Rahul14181
New Member
- Joined
- Jul 24, 2017
- Messages
- 6
Hey Everyone,
I found below link to select the name range on the basis of cell value Below code is working fine but i want that my cursor should be on the starting of the selected names range or first cell of names range like a hyperlink..
Can you please suggest me , what needs to be done in below code?
Sub test()
Application.ScreenUpdating = False
Dim Ash As Worksheet
Dim stxt1 As String
Dim stxt2 As String
Dim stxt3 As String
Set Ash = ActiveWorkbook.ActiveSheet
stxt1 = "AUSTRALIA"
stxt2 = "AUSTRIA"
stxt3 = "SINGAPORE"
If Ash.Range("J1") = stxt1 Then
With Ash
.Range("B10:L10").Select
End With
End If
If Ash.Range("J1") = stxt2 Then
With Ash
.Range("D10:E10").Select
End With
End If
If Ash.Range("J1") = stxt3 Then
With Ash
.Range("E10:F10").Select
End With
End If
Application.ScreenUpdating = True
End Sub
I found below link to select the name range on the basis of cell value Below code is working fine but i want that my cursor should be on the starting of the selected names range or first cell of names range like a hyperlink..
Can you please suggest me , what needs to be done in below code?
Sub test()
Application.ScreenUpdating = False
Dim Ash As Worksheet
Dim stxt1 As String
Dim stxt2 As String
Dim stxt3 As String
Set Ash = ActiveWorkbook.ActiveSheet
stxt1 = "AUSTRALIA"
stxt2 = "AUSTRIA"
stxt3 = "SINGAPORE"
If Ash.Range("J1") = stxt1 Then
With Ash
.Range("B10:L10").Select
End With
End If
If Ash.Range("J1") = stxt2 Then
With Ash
.Range("D10:E10").Select
End With
End If
If Ash.Range("J1") = stxt3 Then
With Ash
.Range("E10:F10").Select
End With
End If
Application.ScreenUpdating = True
End Sub