+ Reply to Thread
Results 1 to 8 of 8

VBA code remove all formulas from entire workbook without losing original file

  1. #1
    Forum Contributor
    Join Date
    07-27-2018
    Location
    Jodhpur, India
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 Pro 64-bit)
    Posts
    405

    VBA code remove all formulas from entire workbook without losing original file

    Hello Expert,

    I have a VBA code that remove all formulas from the entire workbook. However, it is now working on the file where the code will be executed. Is it possible that if we select a file that needs all of the formulas removed, it will not spoil that file and instead make a copy without the formulas in the preset folder or the same directory, depending on which choice we choose? Please assist me if this is possible. Thank you in advance.

    Please Login or Register  to view this content.

    PJ


    Learning One New Thing Everyday!

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA code remove all formulas from entire workbook without losing original file

    Add something to identify the workbook and make a simple change to the For ... Next block

    Please Login or Register  to view this content.
    ... then save it where ever.

  3. #3
    Forum Contributor
    Join Date
    07-27-2018
    Location
    Jodhpur, India
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 Pro 64-bit)
    Posts
    405

    Re: VBA code remove all formulas from entire workbook without losing original file

    Actually, I am new to VBA and am learning it on a daily basis. In the code, I've made a few adjustments. However, it is functional, but the file extension is changing. Can you assist me in resolving this issue?

    Please Login or Register  to view this content.
    Attached Images Attached Images
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA code remove all formulas from entire workbook without losing original file

    If you're appending text to the end of the filename then, yes, the extension is going to change.

    Try appending the date to the base filename then adding the extension

  5. #5
    Forum Contributor
    Join Date
    07-27-2018
    Location
    Jodhpur, India
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 Pro 64-bit)
    Posts
    405

    Re: VBA code remove all formulas from entire workbook without losing original file

    I have changed the code:

    Please Login or Register  to view this content.
    But, the file name still has the extension name prior to the date; how can this be removed? Please suggest.
    Attached Images Attached Images

  6. #6
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA code remove all formulas from entire workbook without losing original file

    Please, turn off that stupid Explorer option to 'Hide extensions for known file types' and then look at the filename again. It might also help if you read Help on the .NAME property for a workbook.

    I can't help further.

  7. #7
    Forum Contributor
    Join Date
    07-27-2018
    Location
    Jodhpur, India
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 Pro 64-bit)
    Posts
    405

    Re: VBA code remove all formulas from entire workbook without losing original file

    Hi, cytop!

    Thank you for responding once again. However, as you can see in the screenshot of the file name, the option to hide file extensions is already disabled. The extension appears before the date, rather than at the end of the name.

    I can't help further.
    Okay, Thank you so much for your assistance.

  8. #8
    Forum Contributor
    Join Date
    07-27-2018
    Location
    Jodhpur, India
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 Pro 64-bit)
    Posts
    405

    Re: VBA code remove all formulas from entire workbook without losing original file

    Hi All,

    I have found the solution on google. Here is the final code:

    Please Login or Register  to view this content.

+ 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] Create new workbook named for Cell in original workbook and copy some sheets from original
    By ANDREAAS in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-09-2019, 01:40 PM
  2. "file opener" - code to open another workbook, save as, and close both original files
    By Arnold Layne in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-10-2019, 01:08 PM
  3. remove entire row from the whole workbook contains a persons name.
    By chriswrcg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2018, 08:35 AM
  4. Replies: 5
    Last Post: 03-30-2016, 12:32 PM
  5. [SOLVED] How to copy formulas to new workbook without referencing original source
    By TPS in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-11-2013, 08:47 PM
  6. Error when executing VBA code to remove all formulas from Workbook
    By brharrii in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 06-17-2013, 05:17 PM
  7. Formulas are pasting with references back to original workbook.
    By ugogirl2005 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-02-2012, 10:41 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