Results 1 to 7 of 7

multiplying numbers in two different columns with a loop code

Threaded View

  1. #1
    Registered User
    Join Date
    06-03-2020
    Location
    Japan
    MS-Off Ver
    2010
    Posts
    14

    Smile multiplying numbers in two different columns with a loop code

    Hey guys,

    I work for a machinery company and I import 100 ~ 300+ excels files into 1 single file by using excel power query,

    Each excel file contains a number for (Machines) and 3 numbers for (Parts), I need to multiply the above numbers to calculate the total purchase amount.

    Please refer to the picture below:
    excel 3.png

    Each color represents a different excel file(all files are in the same format), the best way I can come up with is to write a code for each excel file:

    D3=$B$2*$A3
    D4=$B$2*$A4
    D5=$B$2*$A5

    D8=$B$7*$A8
    D9=$B$7*$A9
    ............etc

    There are more than 2000+ lines and it would take too much time to write a code for every single column,

    I'm wondering if there is a way to use loop for excel to select the respective columns that need to be multiplied and stop when it reaches the bottom of the worksheet.

    I have been looking for a solution for days and still can't figure out a way to do it as I'm new to VBA.

    I would really appreciate your help, thanks
    Last edited by blackragon; 06-03-2020 at 12:23 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 12-12-2018, 05:00 AM
  2. Multiplying columns with omitting negative numbers
    By nirmishkb in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-15-2018, 01:28 AM
  3. [SOLVED] Code for multiplying two columns
    By HonestlyUgly in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-28-2018, 08:05 PM
  4. Replies: 5
    Last Post: 01-06-2014, 03:31 PM
  5. Replies: 6
    Last Post: 04-27-2013, 05:54 PM
  6. Multiplying columns of numbers
    By Electra13 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-06-2008, 08:31 AM
  7. [SOLVED] Multiplying 2 columns- one with numbers only, one with a number &
    By Kel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-22-2005, 03:05 PM

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