+ Reply to Thread
Results 1 to 7 of 7

Multipying columns and rows using VBA

  1. #1
    Registered User
    Join Date
    01-07-2020
    Location
    Canada
    MS-Off Ver
    QC
    Posts
    5

    Multipying columns and rows using VBA

    Hi All,

    I currently need help with the following problem.

    This is a fairly simple problem that can be solved with a general excel formula, but if I drag the formula across the column there's a lot of tidying up to do to make it function for all cells.

    so my formula is based on cell E6 (shown in the attached picture): =4*(C7*E3)+2*(C8+E4)
    this formula just computes the area based on how many items I have.

    is there a way I can make this into a VBA function that will compute the area in cells E6 to CV6, E11 to CV11, E16 to CV16 etc all the way down to E182 to CV182?

    As you can see I've started using basic excel cell formula, but to fix the formula for every cell after dragging it become long. The highlighted cells is where I want to the cell to calculate the area

    Thanks would greatly be appreciated
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by Cassidyjos; 01-13-2020 at 03:46 PM.

  2. #2
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Multipying columns and rows using VBA

    can you attach a sample workbook.
    also, enter few results [manually calculated].
    1. Click on the * Add Reputation if you think this helped you
    2. Mark your thread as SOLVED when question is resolved

    Modytrane

  3. #3
    Registered User
    Join Date
    01-07-2020
    Location
    Canada
    MS-Off Ver
    QC
    Posts
    5

    Re: Multipying columns and rows using VBA

    I have uploaded a sample file

  4. #4
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Multipying columns and rows using VBA

    use this in E6 and drag it across and down.

    HTML Code: 

  5. #5
    Registered User
    Join Date
    01-07-2020
    Location
    Canada
    MS-Off Ver
    QC
    Posts
    5

    Re: Multipying columns and rows using VBA

    Thanks, Much Appreciated!!!!!

  6. #6
    Registered User
    Join Date
    01-07-2020
    Location
    Canada
    MS-Off Ver
    QC
    Posts
    5

    Re: Multipying columns and rows using VBA

    Hi,

    Can you explain me how the MOD(ROW(),-1,5) function work?
    I'm trying to apply it to another cell and It doesn't seem to work. I don't quite understand the MOD() function.

    Thanks

  7. #7
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Multipying columns and rows using VBA

    MOD function gives you remainder after a division operation.
    So, in this case ROW number minus one is divided by 5.
    I am subtracting one because the row numbers are 6, 11, 16 etc.
    Then I am testing to see if remainder is 0 [it means the value is multiple of 5].

+ 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. Replies: 1
    Last Post: 05-30-2015, 03:12 PM
  2. [SOLVED] Formula to transpose rows to new columns and columns to new rows in Excel
    By bjnockle in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-26-2014, 06:28 PM
  3. Multipying Multiple ComboBoxes on a Vba userform
    By smurfdjman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-22-2013, 06:52 PM
  4. [SOLVED] Swapping rows for columns and columns for rows in a large database
    By Bloomingdales in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2012, 06:06 PM
  5. and/or formula for dividing and then multipying
    By tvonbehren in forum Excel General
    Replies: 2
    Last Post: 11-07-2011, 06:01 PM
  6. Replies: 0
    Last Post: 11-28-2007, 06:46 AM
  7. Multipying columns that contail null values
    By ChuckW in forum Excel General
    Replies: 1
    Last Post: 09-06-2005, 09:05 PM

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