0

I'm working with a large Excel file and need to create CSV exports of several worksheets at different times. When the exports are created they should be saved the same directory as the Excel file which can change but the macro should follow the file so that the CSV files are always created in the same location.

Pᴇʜ
  • 56,719
  • 10
  • 49
  • 73
  • Working in excel 2016 – I. Rookie Jul 07 '17 at 04:01
  • 2
    Use [this technique](https://stackoverflow.com/a/44893446/4926357) and loop on the worksheets. – A.S.H Jul 07 '17 at 04:03
  • this looks like I have to modify the code for each specific sheet name is that correct? I don't want to have to do that bec that would create separate macros. I would like to just run the macro on each tab as I'm ready to prepare the csv export – I. Rookie Jul 07 '17 at 05:06
  • 2
    Loop on the worksheets (`Dim ws As Worksheet For Each ws in ThisWorkbook.Worksheets`) and use `ws.Name` to get the sheet's name. – A.S.H Jul 07 '17 at 05:49
  • I can't get this to work. I need a generic code that will work with a copy and paste. – I. Rookie Jul 07 '17 at 14:20

0 Answers0