View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Select all rows on a sheet from a fixed starting point

Maybe this

Sub Macro2()
Rows("3:3").Copy
lastrow = Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row
Rows("5:" & lastrow).Select
For x = 5 To lastrow
Cells(x, 1).Select
If ActiveCell.Value = "P" Then
ActiveCell.PasteSpecial Paste:=xlPasteFormats
End If
Next
End Sub

Mike

"Niniel" wrote:

That worked very nicely, thank you very much.
If it's not too much to ask for, I'd also like to tackle the second part of
my problem - I need to select the same rows again, and this time apply the
formatting of row 3 to all rows where the cell in column A contains a "P".