+ Reply to Thread
Results 1 to 66 of 66

Need VBA to create new Workbook and name it based on cell value in original file

Hybrid View

YukonSoDank Need VBA to create new... 04-07-2019, 03:40 PM
Mumps1 Re: Need VBA to create new... 04-07-2019, 04:09 PM
YukonSoDank Re: Need VBA to create new... 04-07-2019, 04:21 PM
YukonSoDank Re: Need VBA to create new... 04-07-2019, 04:36 PM
Mumps1 Re: Need VBA to create new... 04-07-2019, 04:44 PM
YukonSoDank Re: Need VBA to create new... 04-07-2019, 05:01 PM
Mumps1 Re: Need VBA to create new... 04-09-2019, 09:28 AM
YukonSoDank Re: Need VBA to create new... 04-09-2019, 12:30 PM
Mumps1 Re: Need VBA to create new... 04-09-2019, 12:38 PM
YukonSoDank Re: Need VBA to create new... 04-09-2019, 01:03 PM
Mumps1 Re: Need VBA to create new... 04-09-2019, 01:07 PM
YukonSoDank Re: Need VBA to create new... 04-09-2019, 02:32 PM
YukonSoDank Re: Need VBA to create new... 04-09-2019, 07:54 PM
Mumps1 Re: Need VBA to create new... 04-10-2019, 10:32 AM
YukonSoDank Re: Need VBA to create new... 04-13-2019, 11:28 AM
Mumps1 Re: Need VBA to create new... 04-13-2019, 03:10 PM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 07:37 AM
Mumps1 Re: Need VBA to create new... 05-08-2019, 09:12 AM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 09:29 AM
Mumps1 Re: Need VBA to create new... 05-08-2019, 09:56 AM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 10:07 AM
Mumps1 Re: Need VBA to create new... 05-08-2019, 10:16 AM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 10:23 AM
Mumps1 Re: Need VBA to create new... 05-08-2019, 10:32 AM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 01:09 PM
Mumps1 Re: Need VBA to create new... 05-08-2019, 03:10 PM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 03:13 PM
Mumps1 Re: Need VBA to create new... 05-08-2019, 03:20 PM
YukonSoDank Re: Need VBA to create new... 05-08-2019, 08:31 PM
Mumps1 Re: Need VBA to create new... 05-09-2019, 08:13 AM
YukonSoDank Re: Need VBA to create new... 05-09-2019, 11:24 AM
Mumps1 Re: Need VBA to create new... 05-09-2019, 11:35 AM
YukonSoDank Re: Need VBA to create new... 05-09-2019, 08:59 PM
Mumps1 Re: Need VBA to create new... 05-10-2019, 08:32 AM
YukonSoDank Re: Need VBA to create new... 05-10-2019, 09:13 AM
Mumps1 Re: Need VBA to create new... 05-10-2019, 01:22 PM
YukonSoDank Re: Need VBA to create new... 05-13-2019, 07:25 PM
Mumps1 Re: Need VBA to create new... 05-14-2019, 10:11 AM
YukonSoDank Re: Need VBA to create new... 05-14-2019, 09:13 PM
Mumps1 Re: Need VBA to create new... 05-15-2019, 11:07 AM
Mumps1 Re: Need VBA to create new... 05-16-2019, 08:30 AM
YukonSoDank Re: Need VBA to create new... 05-29-2019, 07:57 PM
Mumps1 Re: Need VBA to create new... 05-30-2019, 09:51 AM
YukonSoDank Re: Need VBA to create new... 05-30-2019, 10:24 AM
Mumps1 Re: Need VBA to create new... 05-30-2019, 11:43 AM
YukonSoDank Re: Need VBA to create new... 05-30-2019, 12:34 PM
Mumps1 Re: Need VBA to create new... 05-30-2019, 01:06 PM
YukonSoDank Re: Need VBA to create new... 05-30-2019, 01:44 PM
Mumps1 Re: Need VBA to create new... 05-31-2019, 09:37 AM
YukonSoDank Re: Need VBA to create new... 05-31-2019, 09:45 AM
Mumps1 Re: Need VBA to create new... 05-31-2019, 11:39 AM
YukonSoDank Re: Need VBA to create new... 05-31-2019, 01:15 PM
Mumps1 Re: Need VBA to create new... 05-31-2019, 02:25 PM
YukonSoDank Re: Need VBA to create new... 05-31-2019, 02:53 PM
Mumps1 Re: Need VBA to create new... 06-01-2019, 12:33 PM
YukonSoDank Re: Need VBA to create new... 06-01-2019, 03:28 PM
Mumps1 Re: Need VBA to create new... 06-02-2019, 07:49 AM
YukonSoDank Re: Need VBA to create new... 06-02-2019, 09:23 AM
Mumps1 Re: Need VBA to create new... 06-03-2019, 09:59 AM
YukonSoDank Re: Need VBA to create new... 06-08-2019, 02:47 PM
  1. #1
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,107

    Re: Need VBA to create new Workbook and name it based on cell value in original file

    I had another look. I realized that what was slowing the macro down was all the formulas calculating. The following macro turns off calculation until the macro runs and now it works fairly quickly. Give it a try.
    Sub SumValues()
        Application.ScreenUpdating = False
        Application.Calculation = xlCalculationManual
        Dim LastRow As Long, Val As Range, ws As Worksheet, desWS As Worksheet, srcRng As Range
        Set desWS = Sheets("Summary_Cash_Flow")
        desWS.Range("C5:PG14,D18:PG22,C26:PG31,D35:PG36,C40:PG40,C44:PG47").ClearContents
        LastRow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
        For Each ws In Sheets
            If ws.Name Like "Cash_Flow_*" Then
                Set srcRng = ws.Range("C5:PG14,D18:PG22,C26:PG31,D35:PG36,C40:PG40,C44:PG47")
                For Each Val In srcRng
                    desWS.Range(Val.Address).Value = desWS.Range(Val.Address).Value + Val.Value
                Next Val
            End If
        Next ws
        Application.Calculation = xlCalculationAutomatic
        Application.ScreenUpdating = True
    End Sub
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  2. #2
    Registered User
    Join Date
    04-02-2019
    Location
    USA
    MS-Off Ver
    Excel 2013
    Posts
    74

    Re: Need VBA to create new Workbook and name it based on cell value in original file

    Hey There,
    Sorry for the delay, I had to put the project in this thread to the side for a bit but now it's top priority again.

    The last macro you wrote to sum the cash flows works like a charm! Many thanks as always.

    That said it occurred to me that each project will likely not have the same start and/or end date. There was a code you had in the early stages of this that matched dates and values per date across many tabs and it worked perfectly.

    How can I add it to this "Sum" macro to properly aggregate values with the appropriate dates?

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 365
    Posts
    8,107

    Re: Need VBA to create new Workbook and name it based on cell value in original file

    I would have to review all the previous posts and macros that were used to try to remember what I did. It would make it easier and faster if you could attach a file with the varying start and end dates and explain in detail what the issue is.

+ 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. Replies: 5
    Last Post: 10-17-2018, 02:35 AM
  2. [SOLVED] Need to modify macro to also create backup of original file
    By tfilipe in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 08-15-2018, 03:25 PM
  3. open worksheet in a different workbook based on cell name in original workbook
    By thara95 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-03-2017, 07:38 AM
  4. VBA that works perfectly in one file errors out in a new file based off the original!
    By carthesis in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-09-2016, 07:24 AM
  5. Replies: 1
    Last Post: 07-17-2014, 12:06 PM
  6. Splitting Excel file but want to create data links to original
    By hitchy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2013, 11:46 AM
  7. Trying to create a 2nd workbook to mirror the first, to protect the original
    By zachdking in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-06-2013, 08:11 PM

Tags for this Thread

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