View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
[email protected] david.vantil@gmail.com is offline
external usenet poster
 
Posts: 1
Default If true, paste, then next cell

I am going around in circles trying to get this macro to work. I would
like it to see if the contents of a cell match a perameter. If so I
want it to paste a copied range of data into the cell, then check the
next cell until it either reached an empty cell.

Any suggestions?


Range("$AP$2:$DZ$2").Select
Selection.Copy

Dim rg1 As Range
Set rg1 = Range("AP12")

Do Until IsEmpty(rg1)
If rg1 = "2" Then
ActiveSheet.Paste
Else
Set rg1 = rg1.Offset(1, 0)

End If
Loop
End Sub