View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Gary''s Student
 
Posts: n/a
Default Need help with copy if

Enter and run this small macro:


Sub Macro1()
Dim r1 As Range
Dim r2 As Range
Dim L As Long

Worksheets("scheduled").Activate

For L = 1 To 65536
If Cells(L, 24).Value = "X" Then
Set r1 = Worksheets("scheduled").Range("A:D")
Set r2 = Worksheets("test").Range("A:D")
r1.Copy r2
Exit Sub
Else
End If
Next

End Sub


-- Gary's Student


"jkrist46" wrote:


What I am trying to do is copy column A-D from "scheduled" worksheet to
"test" worksheet if column X has an "X" in the column. Is this
possible and if so how is it done.


--
jkrist46