C
carl
I am experimenting and trying to learn how the code works. I have the code
below. It gets hung on S = "=" & Range(i).Value.
I am trying to have the program take the value in G6 and set that value to
S. Then loop back and take the next value G7 and set that to S.
For i = 6 To 7
Range("G" & i).Select
Dim S As String
S = "=" & Range(i).Value
Selection.Copy
Sheets("TMS").Select
Selection.AutoFilter Field:=1, Criteria1:=S, Operator:=xlAnd
Range("F1").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("CheckNamesSent").Select
Range("I4").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Next i
End Sub
What am I doing wrong ?
Thank you in advance.
below. It gets hung on S = "=" & Range(i).Value.
I am trying to have the program take the value in G6 and set that value to
S. Then loop back and take the next value G7 and set that to S.
For i = 6 To 7
Range("G" & i).Select
Dim S As String
S = "=" & Range(i).Value
Selection.Copy
Sheets("TMS").Select
Selection.AutoFilter Field:=1, Criteria1:=S, Operator:=xlAnd
Range("F1").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("CheckNamesSent").Select
Range("I4").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Next i
End Sub
What am I doing wrong ?
Thank you in advance.