+ Reply to Thread
Results 1 to 4 of 4

how can I make a macro to add data from 2 different columns

  1. #1
    Registered User
    Join Date
    05-05-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    68

    Arrow how can I make a macro to add data from 2 different columns

    Hi Guys,

    This is probably very simple for those of you with a bit of experience but here goes.

    I have stock list, there is a column of data on one sheet 1 for orders and the orders has various stages (work in progress, paid, on the way, arrived). I also have a column of data on sheet 2 for stock held. At the moment I have to manually delete all of the stock from the column on sheet 1 when the status becomes "arrived" and add it to the stock held column on sheet 2. There are many rows of stock so its easy to make mistakes and time consuming having to do it manually.

    Can someone please tell me how to set up a macro/VBA code so that when I click a button a calculation is preformed where it goes down the column on sheet 1 and adds the numbers to the column on sheet 2. There is the same amount of items on both sheets and the positioning if each is the same only the data starts a few rows lower on sheet 1,but apart from that the layout identical. Hope that makes sense.

    To illustrate as a one off calculation on a button click I want to add:

    (bold references are on sheet 1, plain on sheet 2)

    G5 + C2
    G6 + C3
    G7 + C4
    G8 + C5

    etc etc right down to G57 to C54


    Help much appreciated,

    Michael

  2. #2
    Registered User
    Join Date
    05-05-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: how can I make a macro to add data from 2 different columns

    I would really appreciate some help on this one, I've been researching myself when ever I have free time but can't work it out.

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: how can I make a macro to add data from 2 different columns

    I think I understood what you need

    Try this macro on a backup copy of your workbook

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  4. #4
    Registered User
    Join Date
    05-05-2009
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    68

    Re: how can I make a macro to add data from 2 different columns

    I really appreciate you input but that hasn't quite done it. I actually made a slight error, it should match up like this:

    (bold references are on sheet 2 (My Orders), plain on sheet 1 (Main)

    E5 + C2
    E6 + C3
    E7 + C4
    E8 + C5

    etc etc right down to E55 to C52

    Also ideally after the addition everything from the E column on Sheet 2 (My Orders) would be wiped blank.

    I have attached a very simplified version of the project. I made it non Macro in case anybody was worried about viruses etc.
    Attached Files Attached Files

+ 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