+ Reply to Thread
Results 1 to 7 of 7

Macro to erase formulas and Save under same name + Date

  1. #1
    Registered User
    Join Date
    10-12-2010
    Location
    Cakovec, Croatia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Macro to erase formulas and Save under same name + Date

    Hello everyone..

    I searched for a macro to suit my needs but didn't find it..

    I'm looking for a macro to save current sheet (always the first one, always with same name) but only with values (it has vlookups) and formats into another workbook under same workbook name + date. With option to define where to save, to ask the user where to save.

    If you can, please explain a bit how the code works, so I can learn..

    Thanks!

    Vedran C.
    Last edited by vedranc; 10-19-2010 at 03:47 PM.

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Macro to erase formulas and Save under same name + Date

    Here is a macro that may suit your needs. You can place this in a Module in the workbook you are working with. I have included comments to explain the code. Please ask if you need further assistance.
    Please Login or Register  to view this content.
    Bob
    Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.

  3. #3
    Registered User
    Join Date
    10-12-2010
    Location
    Cakovec, Croatia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Macro to erase formulas and Save under same name + Date

    Thank you!

    What does this mean: xlPasteValuesAndNumberFormats, Number formats? I added Paste Special Paste Formats to leave the cell color.

    Also, how to change the date order? To be more readable, like 19-10-10?

    Another thing. Many cells have vlookups, so when they are copied to another workbook, without formula it shows #N/A. How can that be erased. So if there is no value in the cell, then it's empty.

    Edit: I figured the date format..dd-mm-yyyy
    Last edited by vedranc; 10-19-2010 at 03:24 PM.

  4. #4
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Macro to erase formulas and Save under same name + Date

    Quote Originally Posted by vedranc View Post
    Thank you!

    What does this mean: xlPasteValuesAndNumberFormats, Number formats? I added Paste Special Paste Formats to leave the cell color.

    Also, how to change the date order? To be more readable, like 19-10-10?

    Another thing. Many cells have vlookups, so when they are copied to another workbook, without formula it shows #N/A. How can that be erased. So if there is no value in the cell, then it's empty.

    Edit: I figured the date format..dd-mm-yyyy
    Below I added the paste format like you wanted, changed, the date format, and replaced all "N/A" with blanks. Does that do ya?
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-12-2010
    Location
    Cakovec, Croatia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Macro to erase formulas and Save under same name + Date

    Excellent!

    Once again, thank you.
    If I'll need something else, I'll let you know..
    And i'll probably ask you some more questions regarding the code when i go through it again, to learn.

    BTW, as a beginner in making macro, code writing, what should I read? I don't need any advanced knowledge but something to start with, so I could make some macros myself..

  6. #6
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Macro to erase formulas and Save under same name + Date

    There are many ways to learn VBA and I don't know what suits you best. There are many tutorials on Microsoft's MSDN web site. Here is one example. You can also use the VBA help to see what an individual collection, object, property, method, or event handler does, either by searching on the name, or put the cursor in the word in the code and pressing F1. Hope this helps a little.

  7. #7
    Registered User
    Join Date
    10-12-2010
    Location
    Cakovec, Croatia
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: Macro to erase formulas and Save under same name + Date

    Helps a lot! Didn't know about that one with cursor.. i'll look more into it..

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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