+ Reply to Thread
Results 1 to 3 of 3

Trying to Create a Macro that Applies to Entire Columns

  1. #1
    Registered User
    Join Date
    02-06-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    Trying to Create a Macro that Applies to Entire Columns

    Hello,

    I needed to create a cell (ex. H2) in which I could enter an amount (ex. 2), and the adjacent cell (ex. G2) would keep a running total of all the values entered into H2. For example, I enter '2' three times into H2, and cell G2 would show '6', the sum of all the entries into H2. Some more context: I want to keep an inventory of quanitites used and remaining- so I enter the quantity used at any given time into H2 (Column is Called 'Used Today'), for example 1 (kg), and then I have the cell next to it, G2, keep a running total (Column G is 'Total Used'). This is then subtracted from 'Starting Quantity' to give me the remaining quantity. I was successful in finding a macro program that would do this for me (see below).

    However, as I'm not familiar with macros/VB, I don't know how to expand this to the entire column (columns G and H). Specifially, I have a list of various items of which I want to keep track of the quantities used. I essentially want the macro to apply to the entire column- every time a quantity is added into a cell in column H, the adjacent cell in that row (column G) will keep a running total. For example I enter '2' into H7 four times, G7 will disply '8'....and I want this to occur for all (or a defined amount of) rows in columns G and H.

    What macro/program would do this for me?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert p24leclerc's Avatar
    Join Date
    07-05-2010
    Location
    Québec
    MS-Off Ver
    Excel 2021
    Posts
    2,081

    Re: Trying to Create a Macro that Applies to Entire Columns

    The following macro should do it:
    Please Login or Register  to view this content.
    Pierre Leclerc
    _______________________________________________________

    If you like the help you got,
    Click on the STAR "Add reputation" icon at the bottom.

  3. #3
    Registered User
    Join Date
    02-06-2013
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Trying to Create a Macro that Applies to Entire Columns

    A HUGE thank you! That is exactly what I needed.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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