+ Reply to Thread
Results 1 to 12 of 12

MACRO Save every sheet separatly but text only! with no formulas

  1. #1
    Registered User
    Join Date
    12-30-2016
    Location
    Edinburgh, UK
    MS-Off Ver
    2013
    Posts
    29

    MACRO Save every sheet separatly but text only! with no formulas

    Hi

    As in the title.

    I would like to save every sheet from spread sheet separately as excel files.

    The macro I am using does it but I cannot upload the files to my software as the files contain formulas from the original file.

    Hence my question, how to save the sheets separately but with text only?

    That is what I used

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: MACRO Save every sheet separatly but text only! with no formulas

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: MACRO Save every sheet separatly but text only! with no formulas

    I'd do it like below using similar concept, which keeps formula in the original, but change SaveAs workbook to values only.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-30-2016
    Location
    Edinburgh, UK
    MS-Off Ver
    2013
    Posts
    29

    Re: MACRO Save every sheet separatly but text only! with no formulas

    That is ok but I just realised that the file still cannot be uploaded as it cannot be read by Notepad. So I changed the file extension to .CSV

    Please Login or Register  to view this content.
    and the file seems to be "corrupted" -

    The file cannot be recognised by my software where I am trying to upload it. In Notepad I see a lot of weird signs so I'm guessing the software also cannot read it.

    The message I get when opening the CSV file says:

    "The file you are trying to open, 'name.csv', is in a different format then specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?"

  5. #5
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: MACRO Save every sheet separatly but text only! with no formulas

    ... so you need CSV? You'd do it like below then. Notice the second argument added for SaveAs.

    Please Login or Register  to view this content.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

  6. #6
    Registered User
    Join Date
    12-30-2016
    Location
    Edinburgh, UK
    MS-Off Ver
    2013
    Posts
    29

    Re: MACRO Save every sheet separatly but text only! with no formulas

    Heyah

    This one seems to be working

    Please Login or Register  to view this content.
    Many thanks for help!

  7. #7
    Registered User
    Join Date
    12-30-2016
    Location
    Edinburgh, UK
    MS-Off Ver
    2013
    Posts
    29

    Re: MACRO Save every sheet separatly but text only! with no formulas

    CK76 - yours is also working

    Many thanks

  8. #8
    Registered User
    Join Date
    12-30-2016
    Location
    Edinburgh, UK
    MS-Off Ver
    2013
    Posts
    29

    Re: MACRO Save every sheet separatly but text only! with no formulas

    Hi again,

    The macro above saves all the files in US format and I need it in UK format (i.e. all data with £ sign is saved in a new csv fikles with $ sign). Any tip how to fix it?

    Many thanks

  9. #9
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: MACRO Save every sheet separatly but text only! with no formulas

    Please upload sample workbook, which replicates your issue when code is run.
    Without it, it's very difficult to pinpoint the cause.

  10. #10
    Registered User
    Join Date
    12-30-2016
    Location
    Edinburgh, UK
    MS-Off Ver
    2013
    Posts
    29

    Re: MACRO Save every sheet separatly but text only! with no formulas

    That should now be attached

    Quick explanation - The sheet "Paste Special" has two buttons assigned to macros. The one called "split sheets" saves all sheets separatelly as CSV files. But when you look at the "Data In" sheet it is oryginally provided with price in £ while the new created CSV is in $. And this is what makes the problem here.
    Attached Files Attached Files
    Last edited by Scavenger102; 04-05-2018 at 10:01 AM. Reason: more details

  11. #11
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: MACRO Save every sheet separatly but text only! with no formulas

    I can't replicate the problem. I ran your macro in the example workbook and this is the the text from the result csv file for the Data In sheet.

    Errors,,1,2,3,4,,,,,,,,,,,,,,,,,,,,
    42,Price Per Test,Royal Free Pharmacy,Royal Free Pharmacy,Royal Free Pharmacy,Royal Free Pharmacy,,,,,,,,,,,,,,,,,,,,
    Endotoxin Test - Water,£29.00,1,3,1,3,,,,,,,,,,,,,,,,,,,,
    Endotoxin Test - Pharmaceuticals,£39.20,2,1,2,,,,,,,,,,,,,,,,,,,,,
    Endotoxin Test - Renal Product ,£33.65,,,,,,,,,,,,,,,,,,,,,,,,
    HTM 2030 Suite of Tests,£58.60,,,,,,,,,,,,,,,,,,,,,,,,
    Total Viable Count ,£20.00,,,,,,,,,,,,,,,,,,,,,,,,
    Conductivity Test,£4.80,,,,,,,,,,,,,,,,,,,,,,,,
    Hardness Assay,£4.80,,,,,,,,,,,,,,,,,,,,,,,,
    Heavy Metals Assay,£7.00,,,,,,,,,,,,,,,,,,,,,,,,
    Total Organic Carbon Test,£0.00,,,,,,,,,,,,,,,,,,,,,,,,
    Nitrates Test,£4.00,,,,,,,,,,,,,,,,,,,,,,,,
    Validation of Pharmaceutical,£280.80,,,,,,,,,,,,,,,,,,,,,,,,
    Full Chemistry Suite of Tests,£108.45,,,,,,,,,,,,,,,,,,,,,,,,
    Period (mth - mth YR),,February 2018,February 2018,February 2018,February 2018,,,,,,,,,,,,,,,,,,,,
    ,,SR,SR,SR,SR,,,,,,,,,,,,,,,,,,,,
    Contact Name:,,Clarissa Coker,Clarissa Coker,Clarissa Coker,Clarissa Coker,,,,,,,,,,,,,,,,,,,,
    Purchase Order Number:,,RQC0201830,RQC0208832,RQC0215837,RQC0222840,,,,,,,,,,,,,,,,,,,,
    Customer Code,,D276,D276,D276,D276,,,,,,,,,,,,,,,,,,,,

  12. #12
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: MACRO Save every sheet separatly but text only! with no formulas

    Same for me. It correctly outputs result as how it's displayed in Excel cell.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Two ranges good separatly but not together
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-25-2017, 10:46 AM
  2. Duplicate sheet, delete data but save formulas
    By jimgkiss in forum Excel General
    Replies: 5
    Last Post: 10-17-2016, 10:04 AM
  3. Open Excel separatly
    By Marianus in forum Excel General
    Replies: 3
    Last Post: 10-28-2013, 02:09 PM
  4. [SOLVED] Save sheet without the formulas
    By tigergutt in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-13-2013, 07:03 AM
  5. Macro - Add row, auto fill text and formulas with relative OFFSSET, Sheet reference functi
    By DaliosPerlai in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2012, 10:47 AM
  6. Replies: 1
    Last Post: 06-29-2012, 01:16 PM
  7. Copy Sheet (New) > Remove formulas > Save
    By ExcelAteMyHomework in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-21-2012, 08:33 AM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1