Trying to have macro filter everything in a column and save individual workbooks per sorted item in excel vba -


i have report sorted column c. need save individual workbooks based off of each item column c. there headers in row 1.

below code believe should work isn't. unsure how site specifc folder save to.

 if target.address = "$c$2"   fname = range("c2")   activeworkbook.saveas filename:=fname  end if 

here's macro handle targeting cells in sheet. must placed specific sheet's code. example of fname value stored in c2 cell is: c:\users\taisho\desktop\example.xlsx reason why macro not working not assigning variable type target.

option explicit  private sub worksheet_selectionchange(byval target range)  dim fname string      if target.address = "$c$2"     fname = range("c2").value2     activeworkbook.saveas filename:=fname end if  end sub 

Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -