Hello. I've been trying to write a vba code that will reference a list of names on one sheet, find the name in a list on another sheet, and hide the row the name appears in on the 2nd sheet. I've gotten to where I can do so for a single name but can't get the language right for the loop, lookup.
I currently have these two subs in the workbook. Looks like a combination of the two:
Any help is appreciated.
I currently have these two subs in the workbook. Looks like a combination of the two:
VBA Code:
Sub SearchMe()
Application.ScreenUpdating = False
Dim rng1 As Range
Dim strSearch As String
strSearch = ActiveCell.Value
Application.ScreenUpdating = False
Set rng1 = Range("o156:O159").Find(strSearch, , xlValues, xlWhole)
If Not rng1 Is Nothing Then
rng1.ClearContents
Range("p12").Select
Else
MsgBox "Name Is Not In The List."
End If
Application.ScreenUpdating = True
End Sub
VBA Code:
Sub HideRows()
Application.ScreenUpdating = False
Application.Calculation = xlManual
UNPROTECT
ActiveSheet.Select
For Each C In Range("d50:d500")
If C.Value = 0 Or C.Value = "" Then Rows(C.Row).Hidden = True
Next
'' Rows("132:167").EntireRow.Hidden = False
PROTECT
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
End Sub
Any help is appreciated.