Results 1 to 10 of 15

Thread: VBA Macro To Create An Excel File With Same Sheet Name As Workbook Name

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    Aug 2012
    Posts
    40
    Rep Power
    0

    Macro to create CSV with same sheetname as Excel xlsm file

    Alan -Thanks for your help and detailed explanation

  2. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Quote Originally Posted by Flupsie View Post
    Alan -Thanks for your help and detailed explanation
    Your welcome.

    One last point that might help in the understanding here:

    When you “work on a file”_.. you do not actually work on a file !!!

    When you “open”” a file _... you do not actually open a file !!!
    _..........................

    With Excel in front of you, what you see, and what you have, the "thing" , is something which can pretty well do all that Excel has to offer. That includes data, Formatting, Worksheets, VBA Macros, Graphics, Charts -..... etc.. etc..

    When you “Open” a file, the following is actually what happens:
    A Copy is made of that file that you “open” as it stands at the point that you opened it. That copy is put into what you have in front of you and is represented as it would be in this “thing” which can do all that Excel has to offer. You can add Worksheets, add and run macros etc.. etc.. This is independent of what type of file you “open”.

    What you have in front of you is not a file.

    When you “save” , the following happens:

    Excel looks at the type you save as ( for example .xlsx or .CSV or .xlsm or .xlsx _... etc. ). Excel then “takes” from what it has in front of you what it “needs” to create or overwrite the File of the name you give it.

    So for examples,
    by saving as .xlsm it takes just about everything
    by saving as .xlsx it takes most except for any macro stuff.

    By saving as .CSV it takes only data, nothing else. So it ignores any Worksheets or worksheet names you may have made or changed to / in the “thing” that was in front of you. - ( And as we have seen, in the case of a .CSV file, Excel has the annoying and confusing habit of putting the file name in the tab at the bottom in the “thing” in front of you when you “open” a .CSV file. After “opening” you could add and change the tabs at the bottom. But the value in it / those are only of significance if you save as some other type than .CSV, such as .xls or .xlsm or .xls etc.
    By saving as .CSV it ignores anything written in any tabs. The .CSV File will only take and hold data, nothing else)

    Alan

    ‘ Ref http://www.mrexcel.com/forum/excel-q...ml#post4425428
    ….If you are my competitor, I will try all I can to beat you. But if I do, I will not belittle you. I will Salute you, because without you, I am nothing.
    If you are my enemy, we will try to kick the fucking shit out of you…..
    Winston Churchill, 1939
    Save your Forum..._
    KILL A MODERATOR!!

Similar Threads

  1. Replies: 4
    Last Post: 07-02-2013, 11:32 AM
  2. Replies: 4
    Last Post: 06-18-2013, 01:38 PM
  3. VBA To Create A New Workbook
    By cdurfey in forum Excel Help
    Replies: 9
    Last Post: 05-23-2013, 06:41 PM
  4. Excel VBA Macro To Open A File Through Browse Dialog Box
    By Safal Shrestha in forum Excel Help
    Replies: 2
    Last Post: 04-05-2013, 12:59 PM
  5. Replies: 1
    Last Post: 06-02-2011, 10:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •