ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro Question (https://www.excelbanter.com/excel-worksheet-functions/107375-macro-question.html)

Carl

Macro Question
 
Thought I would try a new post instead of trying to work on a previous one.

I am using this:

Sub temp()
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
End Sub

Note that 'Selection.AutoFilter Field:=1, Criteria1:=S, Operator:=xl' the
variable S needs definition.

I have a list in G6:G8. I need the above code to repeat for each value in
this list. Not sure how to do this (as it is important that the "S" value
also updates to reflect the next vlaue in the list - G6, G7,G8).

THank you in advance.



All times are GMT +1. The time now is 10:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com