Hi All,
I'm trying to put some VBA together to search for a name on five works sheet then copy the row by a defined number of columns to a specific row on another sheet.
Each sheet contains the name once and a list of skills in the cells I need to copy to create a master record.
I would also like it to match it exactly and if no match is found display a pop up saying no exact match found.
So far I have....
Any help appreciated....
I'm trying to put some VBA together to search for a name on five works sheet then copy the row by a defined number of columns to a specific row on another sheet.
Each sheet contains the name once and a list of skills in the cells I need to copy to create a master record.
I would also like it to match it exactly and if no match is found display a pop up saying no exact match found.
So far I have....
Code:
Sub skillsearch()
Dim strLastRow As String
Dim rngC As Range
Dim strToFind As String, FirstAddress As String
Dim wSht As Worksheet
Dim rngtest As String
Application.ScreenUpdating = False
Set wSht = Worksheets("Electricity")
strToFind = InputBox("Enter Consultants Name")
With wSht.Range("B7:B45")
Set rngC = .Find(what:=strToFind, LookAt:=xlPart)
If Not rngC Is Nothing Then
FirstAddress = rngC.Address
Do
strLastRow = Sheets("Search Results").Range("A" & Rows.Count).End(xlUp).Row + 1
rngC.EntireRow.Copy Sheets("Search Results").Cells(strLastRow, 1)
Set rngC = .FindNext(rngC)
Loop While Not rngC Is Nothing And rngC.Address <> FirstAddress
End If
End With
MsgBox ("Finished")
End Sub
Any help appreciated....