This is my code:
Sub Insertrow()
Dim ADF As Variant
ADF = Range("D2")
Selection.Find(What:=ADF, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate _
.EntireRow.Insert shift:=xlDown
End Sub
I highlight the entire column B (Selection) because that's where i want the macro to do the searching. It looks for what I type in cell D2 which is my variant. the code works up until this point. What i need help with is having the code insert an entire row underneath the row with the heading i specified in D2.
Please help!
Sub Insertrow()
Dim ADF As Variant
ADF = Range("D2")
Selection.Find(What:=ADF, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False).Activate _
.EntireRow.Insert shift:=xlDown
End Sub
I highlight the entire column B (Selection) because that's where i want the macro to do the searching. It looks for what I type in cell D2 which is my variant. the code works up until this point. What i need help with is having the code insert an entire row underneath the row with the heading i specified in D2.
Please help!