+ Reply to Thread
Results 1 to 11 of 11

VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refreshed

  1. #1
    Registered User
    Join Date
    04-26-2023
    Location
    Portugal
    MS-Off Ver
    O365
    Posts
    6

    VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refreshed

    Hi guys!

    I'm new in the VBA world, and I have a challenge on my hands, and having difficulties completing it.

    I have a Excel sheet (Master) with some formulas depending on the value of a specific Cell (Example Cell B3).

    In another sheet (Values) I have a list of values (Example Range A2:A30).

    My goal is to build a macro that does the following sequence:

    1 - Copy 1st value of the list (Sheet "Values" Cell A2)
    2 - Paste on cell that has formulas depending on it (Sheet "Master" cell B3)
    3 - Refresh Calculations (Shift + F9)
    4 - Save a Pasted-Values Copy of the Master Sheet in a new Workbook named as the Value of the List copied on Step 1
    5 - Loop the steps above for the remaining values of the Range A2:A30 until it uses all values from the range.


    Can you please help?

    Thanks a lot!
    NSP

  2. #2
    Forum Expert
    Join Date
    05-29-2020
    Location
    NH USA
    MS-Off Ver
    365
    Posts
    2,103

    Re: VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refresh

    To help you, it would help us to have a sample workbook. See yellow banner above.

  3. #3
    Registered User
    Join Date
    04-26-2023
    Location
    Portugal
    MS-Off Ver
    O365
    Posts
    6

    Re: VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refresh

    Hello!

    Yes, of course.

    Please see the file Below. Thank you so much for the help!

    Use Case.xlsb
    Attached Files Attached Files

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refresh

    Here's a pretty basic way to do it.

    Should work without problems but there's plenty that could be improved.
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    04-26-2023
    Location
    Portugal
    MS-Off Ver
    O365
    Posts
    6

    Re: VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refresh

    Quote Originally Posted by Norie View Post
    Here's a pretty basic way to do it.

    Should work without problems but there's plenty that could be improved.
    Please Login or Register  to view this content.
    Hello!

    Thank you so much, it works perfectly, you rock!! :D

    The code is easy to interpretate, making it easy for me to do my minor adjustments.

    Thinking on the 2.0 for this Macro, is it difficult/possible to add an "e-mail sending" funcionality, via Outlook, considering that the destination e-mails for each file are on column F of "Values" Sheet?

    Best Regards,
    NSP

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refresh

    So, as well as creating the new workbooks send them as e-mail attachments too?

  7. #7
    Registered User
    Join Date
    04-26-2023
    Location
    Portugal
    MS-Off Ver
    O365
    Posts
    6

    Re: VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refresh

    Yes!

    Each Workbook goes to a specific and different e-mail address, according to what is filled, for example, on column F of "Values" Sheet, like said above.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refresh

    Again, pretty basic - no error trapping, no fancy e-mail content/formatting etc. but seems to work.
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    04-26-2023
    Location
    Portugal
    MS-Off Ver
    O365
    Posts
    6

    Re: VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refresh

    Quote Originally Posted by Norie View Post
    Again, pretty basic - no error trapping, no fancy e-mail content/formatting etc. but seems to work.
    Please Login or Register  to view this content.
    Hello Norie,

    Thanks again for your help. This time I am having a Run-Time Error -2147221080 (800401a8)

    Do you have a clue why?

    Thanks!
    NSP

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refresh

    What's the error message?

  11. #11
    Registered User
    Join Date
    04-26-2023
    Location
    Portugal
    MS-Off Ver
    O365
    Posts
    6

    Re: VBA formula that creates new workbook from 1 sheet after 1 cell is updated and refresh

    Quote Originally Posted by Norie View Post
    What's the error message?
    Hello!

    Ther is no much detail... Tried again, and the error message is slightly different:

    Attachment 827405

+ 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. Automatic Updation of a Master sheet cell when Subs sheet cell gets updated
    By rmididhoddi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-02-2021, 08:27 AM
  2. Excel Form that automatically creates a new sheet in a Workbook
    By lgsikaffy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-01-2020, 03:08 PM
  3. macro creates sheet with name cell
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 02-05-2019, 04:12 PM
  4. How to email updated rows in multi-sheet workbook
    By gcmax in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-25-2013, 08:28 AM
  5. Last Updated workbook date in sheet
    By kryt0n in forum Excel General
    Replies: 3
    Last Post: 09-12-2012, 03:38 AM
  6. Replies: 0
    Last Post: 06-15-2012, 04:15 PM
  7. [SOLVED] Keeping track of results of refreshed/updated data
    By vitaleca in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-02-2006, 10:50 PM

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