below is a copy of some code that searches my database for an entry in column "C". what i want it to do then is to open user form 2 and in the job number text box, i want job number to be already populated. In user form 2 i have 4 other text boxes for the user to populate. I then want those 4 other entries to populate column "F - I"
user form 1 populates columns "a to e" so i want to be able to search column c and populate colums f to i on the same line
any ideas?
Sub Find_Last()
Dim FindString As String
Dim Rng As Range
FindString = InputBox("Enter a job number")
If Trim(FindString) <> "" Then
With Sheets("Sheet1").Range("C:C")
Set Rng = .Find(What:=FindString, _
After:=.Cells(1), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng, True
Else
MsgBox "Nothing found"
End If
End With
End If
End Sub
user form 1 populates columns "a to e" so i want to be able to search column c and populate colums f to i on the same line
any ideas?
Sub Find_Last()
Dim FindString As String
Dim Rng As Range
FindString = InputBox("Enter a job number")
If Trim(FindString) <> "" Then
With Sheets("Sheet1").Range("C:C")
Set Rng = .Find(What:=FindString, _
After:=.Cells(1), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False)
If Not Rng Is Nothing Then
Application.Goto Rng, True
Else
MsgBox "Nothing found"
End If
End With
End If
End Sub