Pages

Tuesday, February 28, 2012

Sub FindKVV()
'
' FindKVV Macro
' Macro recorded 01-10-2003 by Neale Blackwood
'

Dim FirstRow
Dim FirstColumn

Columns("E:E").Select
Selection.Find(What:="KVV", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate

FirstRow = ActiveCell.Row
FirstColumn = ActiveCell.Column
MsgBox "The Row is " & FirstRow & " the column number is " & FirstColumn

End Sub



Sub mother()
Dim lr As Long, sh As Worksheet, rng As Range
Set sh = ActiveSheet
lr = sh.Cells(Rows.Count, 1).End(xlUp).Row
Set rng = sh.Range("A2:A" & lr)
For i = lr To 2 Step -1
If InStr(sh.Cells(i, 1), "mother") > 0 And _
InStr(sh.Cells(i-1, 1), "mother") > 0 Then
sh.Rows(i).Delete
End If
Next
End Sub

0 comments:

 

site weekly hits