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/106971-macro-question.html)

Carl

Macro Question
 
I'm using this macro:

Range("A2").Select
Selection.Copy
Sheets("TMS").Select
Range("Y2").Select
Selection.AutoFilter Field:=23, Criteria1:="=BOX074", Operator:=xlAnd
Range("F1").Select
Sheets("CheckNamesSent").Select

I am trying to have the "A2" copy inserted into the Criteria1:

Is it possible ?

Thank you in advance.

Gary''s Student

Macro Question
 
Don't use Copy

Dim s as String
..
..
..
s="=" & Range("A2").Value
..
..
..
Selection.AutoFilter Field:=23, Criteria1:= s, Operator:=xlAnd
--
Gary's Student


"carl" wrote:

I'm using this macro:

Range("A2").Select
Selection.Copy
Sheets("TMS").Select
Range("Y2").Select
Selection.AutoFilter Field:=23, Criteria1:="=BOX074", Operator:=xlAnd
Range("F1").Select
Sheets("CheckNamesSent").Select

I am trying to have the "A2" copy inserted into the Criteria1:

Is it possible ?

Thank you in advance.



All times are GMT +1. The time now is 03:03 PM.

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