H
hnyb1
This is the code I have so far; however instead of finding the first
occurrence of what was entered into the input box, I need the last occurrence
in column C. Can anyone help?
Sub Insertinfo()
Dim FindWhat As String
Dim FoundCell As Range
FindWhat = InputBox("Find What", "Find")
If StrPtr(FindWhat) = 0 Then
Exit Sub
End If
On Error Resume Next
Set FoundCell = Range("c:c").Find(What:=FindWhat, _
LookAt:=xlWhole, LookIn:=xlValues)
If FoundCell Is Nothing Then
MsgBox "Not Found"
Else
FoundCell.Activate
With ActiveCell.EntireRow
.Copy
.Insert Shift:=xlDown
End With
End If
Application.CutCopyMode = False
End Sub
Thanks,
Holly
occurrence of what was entered into the input box, I need the last occurrence
in column C. Can anyone help?
Sub Insertinfo()
Dim FindWhat As String
Dim FoundCell As Range
FindWhat = InputBox("Find What", "Find")
If StrPtr(FindWhat) = 0 Then
Exit Sub
End If
On Error Resume Next
Set FoundCell = Range("c:c").Find(What:=FindWhat, _
LookAt:=xlWhole, LookIn:=xlValues)
If FoundCell Is Nothing Then
MsgBox "Not Found"
Else
FoundCell.Activate
With ActiveCell.EntireRow
.Copy
.Insert Shift:=xlDown
End With
End If
Application.CutCopyMode = False
End Sub
Thanks,
Holly