Hello, I have found great information in this forums but now im stuck.
Im trying to make the command button search within the workbook for the value of cell H2.
This is what i have right now, but instead of the input box i want it to automatically choose the value in cell H2 and search within the workbook when i click the command button.
I am basically trying to create a 'menu' in sheet 1. after selecting the what i want in from the scroll bar i want to click the command button so it will take me to the appropriate sheet. If there is an easier way to do this please let me know.
Hope this is enough info.
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Dim rFound As Range
Dim strName As String
On Error Resume Next
strName = InputBox("GO!!!!!!!")
If strName = "" Then Exit Sub
For Each ws In Worksheets
With ws.UsedRange
Set rFound = .Find(What:=strName, After:=.Cells(1, 1), LookIn:=xlValues, LookAt:=xlWhole)
If Not rFound Is Nothing Then
Application.Goto rFound, True
Exit Sub
End If
End With
Next ws
On Error GoTo 0
MsgBox "Value not found"
End Sub
Private Sub ScrollBar1_Change()
End Sub
Thanks for the help.
Im trying to make the command button search within the workbook for the value of cell H2.
This is what i have right now, but instead of the input box i want it to automatically choose the value in cell H2 and search within the workbook when i click the command button.
I am basically trying to create a 'menu' in sheet 1. after selecting the what i want in from the scroll bar i want to click the command button so it will take me to the appropriate sheet. If there is an easier way to do this please let me know.
Hope this is enough info.
Private Sub CommandButton1_Click()
Dim ws As Worksheet
Dim rFound As Range
Dim strName As String
On Error Resume Next
strName = InputBox("GO!!!!!!!")
If strName = "" Then Exit Sub
For Each ws In Worksheets
With ws.UsedRange
Set rFound = .Find(What:=strName, After:=.Cells(1, 1), LookIn:=xlValues, LookAt:=xlWhole)
If Not rFound Is Nothing Then
Application.Goto rFound, True
Exit Sub
End If
End With
Next ws
On Error GoTo 0
MsgBox "Value not found"
End Sub
Private Sub ScrollBar1_Change()
End Sub
Thanks for the help.