+ Reply to Thread
Results 1 to 4 of 4

Vlookup Looping through columns and rows returning sum in total column

  1. #1
    Registered User
    Join Date
    08-07-2013
    Location
    Monroeville, Pa
    MS-Off Ver
    Excel 2010
    Posts
    22

    Vlookup Looping through columns and rows returning sum in total column

    First, I would like to thank anyone who can possibly assist me with the VBA for this spreadsheet.

    The worksheet consists of 10 columns (A-J) and 13 rows (1-13). The first row is a header row that contains eight codes that I need to look up the value in a table and multiple it by the count in each of the cells below. The result of the vlookup for each column needs to be added together and return a total in column J. I have a formlua that works well, however, I would like to convert the formula to VBA and For Each loops confuse me every time. The formula is:

    Please Login or Register  to view this content.
    A sample workbook is attached.

    Any help is greatly appriciated.

    Thank you,
    Eric
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Vlookup Looping through columns and rows returning sum in total column

    Here are two macros - one using your formula, the other using a loop:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    08-07-2013
    Location
    Monroeville, Pa
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Vlookup Looping through columns and rows returning sum in total column

    Macro 2 is perfect, thank you! I really appriciate your help.

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,943

    Re: Vlookup Looping through columns and rows returning sum in total column

    Great! Happy that you liked it...

+ 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. Looping through rows, finding 2 matching columns, returning the 3rd column as a variable
    By orionanomaly in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-27-2018, 09:36 AM
  2. Looping through rows then columns
    By shaggyjh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-10-2018, 05:31 AM
  3. [SOLVED] Checking column for values and returning a running total.
    By Anarza in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-11-2017, 05:53 AM
  4. [SOLVED] Vlookup column change. columns to rows
    By b19upj in forum Excel General
    Replies: 5
    Last Post: 04-06-2016, 11:16 AM
  5. Looping Through Columns And Rows
    By slimjm911 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-08-2012, 08:41 PM
  6. Replies: 4
    Last Post: 01-03-2012, 12:00 PM
  7. [SOLVED] Looping through Columns then Rows
    By JCP in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-30-2005, 12:27 AM

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