+ Reply to Thread
Results 1 to 7 of 7

Help with macro shortcut!

  1. #1
    Registered User
    Join Date
    05-05-2020
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    3

    Help with macro shortcut!

    No experience with coding or macros. Trying to see if there is a simple way to create a shortcut for a repetitive process in an excel budgeting spreadsheet. Essentially the spreadsheet tracks invoices and costs against established budgets (shows costs to date, budget balances, etc.).

    Invoices are plugged in each month when they are received. For example, if I receive an invoice in May 2020 it is captured in the May 2020 column and in the row of the budgeted line item associated with it (e.g. Design Costs). One of the first rows in the spreadsheet is "Costs to-date" which totals invoices received to date. Every month I have to adjust the formula in this column to capture the next month. So now that we are in May 2020, which is column N on my spreadsheet, I have to adjust the range of my formula. So the formula changes from "=SUM(K12:M12)" to "=SUM(K12:N12)". This formula is dragged down and applied to each row to reflect the costs to date for each budget line item.

    As you can see, the formula itself and change I make to it is very simple. The problem is I manage multiple projects, each with its own budget, invoices, and workbook. I'm wondering if there is a shortcut I could create that updates my formula to capture the cell in the very next column, thus extending the selected range. Each month when I update the spreadsheet with current invoices I could simple "press a button" and the formula updates. I tried recording a macro to create a keyboard shortcut, but the problem is it only updates the formula once. It doesn't continue selecting the next column, and the next column, etc. each time I hit the shortcut on my keyboard. Not sure it's something I can record. I must reiterate that I have no clue what I'm talking about in terms of macros and am not sure if this is even possible. I don't know how to adjust the coding in the macro to make it do what I need. I'm having difficulty coming up with the words to even search for what I need through google, so I came here just looking for a place to start. Any advice is appreciated!
    Attached Files Attached Files
    Last edited by Bruce$; 05-05-2020 at 08:03 PM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,986

    Re: Help with macro shortcut!

    See the yellow banner.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,278

    Re: Help with macro shortcut!

    Should be an easy thing... if the workbook was here to see. Can you post an example workbook as described in the yellow banner above?

  4. #4
    Registered User
    Join Date
    05-05-2020
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    3

    Re: Help with macro shortcut!

    See attached.
    Attached Files Attached Files

  5. #5
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,278

    Re: Help with macro shortcut!

    This will overwrite the Sum functions in columns D and E, depending on the current month. Test on a copy of your data.
    Please Login or Register  to view this content.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,986

    Re: Help with macro shortcut!

    I'm confused. The formulae in column F and G look a bit, well, static.

    The SUM formulae to which you refer are elsewhere but I don't understand the logic.

    D6: =SUM(I6:K6)
    E6: =SUM(L6:P6)

  7. #7
    Registered User
    Join Date
    05-05-2020
    Location
    Virginia
    MS-Off Ver
    2016
    Posts
    3

    Re: Help with macro shortcut!

    The columns changed when I adjusted the spreadsheet to get rid of confidential info. That's my mistake. Column D totals the costs to date which, as of the last update to this spreadsheet, would be January through March. Column E totals April through the remainder of the project, August 2020. Sorry for the confusion I didn't adjust my post to reflect the changes in headers, columns, etc. when I removed confidential info.

+ 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. Want to run two macro with one shortcut
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-07-2016, 10:11 AM
  2. Any shortcut to run VBA macro when macro file is close
    By Kalpesh93 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-13-2015, 10:03 AM
  3. Replies: 3
    Last Post: 02-21-2014, 10:19 AM
  4. Replies: 4
    Last Post: 07-15-2013, 02:43 AM
  5. [SOLVED] Macro Shortcut Key
    By MWSoccer18 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-29-2013, 02:12 PM
  6. Shortcut key to VB macro
    By Joe in forum Excel General
    Replies: 4
    Last Post: 12-30-2005, 09:50 AM
  7. [SOLVED] Macro shortcutsWhen you are assigning a keyboard shortcut to a macro?
    By JudithJubilee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-08-2005, 04:06 AM

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