I am just starting out with VBA and copied some macro code (copied from a post on this forum) that filters data and copy/pastes the result into another worksheet. As written and modified for my workbook it works really well, but I have some things I wish to change but can't work out how.
I am attaching a sample of the workbook (with names deleted).
1) I can only make the macro work if I hard code the criteria, but I want to reference cells on the Data worksheet.
2) I don't want to delete and replace the MyAutoFilter worksheet every time, but prefer to paste the results into the Summary worksheet starting in cell A10 and leaving one blank row between each resulting data set. (There are 3 separate pastes in the macro.)
This is the section of code I need to modify to reference a particular cell. Except for the capitalized comment, all other comment rows are from the original macro author. (I tried using Criteria1:="=" & WS.Range("D4").Value but got an error on running the macro.)
I can see lots of benefits in learning about macro VBA and would really appreciate any help I can get with this.
Bookmarks