Thread: Need 2 macros
View Single Post
  #13   Report Post  
Posted to microsoft.public.excel.misc
curlydave curlydave is offline
external usenet poster
 
Posts: 206
Default Need 2 macros

On Mar 1, 7:59*am, CurlyDave wrote:
Try this,

Sub FindValueDeleteRow()
* * Dim s As String, Count As Integer
* * Application.ScreenUpdating = False
* * s = "R"
* * For Count = 1 To ActiveSheet.UsedRange.Rows.Count

* * * * Set f = Cells.Find(s, LookIn:=xlValues)
* * * * If Not f Is Nothing Then
* * * * * * f.EntireRow.Delete * *'Shift:=xlUp
* * * * * * Application.ScreenUpdating = True
* * * * End If
* * Next Count
End Sub
Sub ClearRange()
* * Dim r As Range
* * Set r = Range(Range("A3"), Range("A3").SpecialCells(xlLastCell))
* * r.ClearContents
End Sub


Change

f.EntireRow.Delete 'Shift:=xlUp

f=""
To just clear the contents