Greetings all,
I tried using Record Macro for something simple...I wanted to copy the value of a cell, select the auto filter of a column, select Customize under the filter, Select row "Contains", and paste the value on the right side and hit enter. I have a spreadsheet tool that employees use to find something, and many of them are not very familiar with Excel so I'm trying to make it easier where they can type in a name in cell xx, hit a button, and the list will be filtered to those rows containing the value of the input.
This is what was recorded when I set it up, but as you can see, it wrote the value of the test cell into the macro.
Range("E1").Select
Selection.Copy
Selection.AutoFilter Field:=5, Criteria1:="=*Crazy*", Operator:=xlAnd
End Sub
How can I make this variable to always reference the content of the cell? I changed it to Criteria1:=E1 ...but that didn't work. I'm thinking there's some syntax issue, but I'm not familiar enough with macros. Any help would be appreciated.
Scott
I tried using Record Macro for something simple...I wanted to copy the value of a cell, select the auto filter of a column, select Customize under the filter, Select row "Contains", and paste the value on the right side and hit enter. I have a spreadsheet tool that employees use to find something, and many of them are not very familiar with Excel so I'm trying to make it easier where they can type in a name in cell xx, hit a button, and the list will be filtered to those rows containing the value of the input.
This is what was recorded when I set it up, but as you can see, it wrote the value of the test cell into the macro.
Range("E1").Select
Selection.Copy
Selection.AutoFilter Field:=5, Criteria1:="=*Crazy*", Operator:=xlAnd
End Sub
How can I make this variable to always reference the content of the cell? I changed it to Criteria1:=E1 ...but that didn't work. I'm thinking there's some syntax issue, but I'm not familiar enough with macros. Any help would be appreciated.
Scott