+ Reply to Thread
Results 1 to 14 of 14

Iterate Mutiply&Devide Operations for Each Row

  1. #1
    Forum Contributor
    Join Date
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Iterate Mutiply&Devide Operations for Each Row

    Hi VBA Gurus:

    I need a code to iterate the following tasks on the sheet"Quote Summary" and only.

    Pseudo Code:

    *This code should ONLY valid on the sheet "Quote Summary"

    1, Start from Row 2 on Quote Summary Sheet,
    I2=F2*H2
    J2=F2*G2
    K2=I2/J2

    2, Repeat for all of the rows in the sheet Quote Summary


    Process Sample 6-Iterate Mutiply&Devide Operations for Each Row.xlsm

    Thank you and I am looking forward to your response,

    Chris

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,712

    Re: Iterate Mutiply&Devide Operations for Each Row

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Iterate Mutiply&Devide Operations for Each Row

    Try the attached.

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Iterate Mutiply&Devide Operations for Each Row

    Hi,

    One way

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  5. #5
    Forum Contributor
    Join Date
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Re: Iterate Mutiply&Devide Operations for Each Row

    Thank you so much for your codes!

    They all works very well!

    Chris

  6. #6
    Forum Contributor
    Join Date
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Re: Iterate Mutiply&Devide Operations for Each Row

    Well Actually there is a problem.

    Would you modify your code a little bit so that Ki=Ii/Ji works only when Ji >0, if Ji<=0, just leave Ki empty.

    Thank you,

    Chris

  7. #7
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Iterate Mutiply&Devide Operations for Each Row

    Chris,
    My code has already incorporated that line. It is less than 0, it returns 0.

  8. #8
    Forum Contributor
    Join Date
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Re: Iterate Mutiply&Devide Operations for Each Row

    Hello AB33:

    Not sure why but I could not run your code on my original workbook.

    Also it seems need to Dim parameters as I put this code into a group of other codes within the same module. And the module starts with Option Explicit.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Iterate Mutiply&Devide Operations for Each Row

    Chris,
    Please see attached.
    I normally use Option Explicit as default set up on my codes.
    It forces you to declare all variables used on that module and can correct errors. There are no variables on the attached. You can remove it on this code as it would not make any difference

  10. #10
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,712

    Re: Iterate Mutiply&Devide Operations for Each Row

    Please Login or Register  to view this content.

    Regards, TMS

  11. #11
    Forum Contributor
    Join Date
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Re: Iterate Mutiply&Devide Operations for Each Row

    Quote Originally Posted by AB33 View Post
    Chris,
    Please see attached.
    I normally use Option Explicit as default set up on my codes.
    It forces you to declare all variables used on that module and can correct errors. There are no variables on the attached. You can remove it on this code as it would not make any difference
    Hello ABB33:

    I appreciate your response. The program finally worked. Worked very well with other codes in the same module actually.

    Thank you again for your response!

    Chris

  12. #12
    Forum Contributor
    Join Date
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Re: Iterate Mutiply&Devide Operations for Each Row

    Quote Originally Posted by TMS View Post
    Please Login or Register  to view this content.

    Regards, TMS
    Dear TMS:

    Thanks for your response!

    Just saved this on into my"code library" for future reference.

    Thanks again and have a wonderful one!

    Chris

  13. #13
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Iterate Mutiply&Devide Operations for Each Row

    Hi,

    Please note that there is no need to requote text when responding unless for a specific reference - see forum rule #12.

  14. #14
    Forum Contributor
    Join Date
    06-29-2012
    Location
    Calgary CA
    MS-Off Ver
    Excel 2010
    Posts
    117

    Re: Iterate Mutiply&Devide Operations for Each Row

    @Richard Buttrey

    Thanks for letting me know!

    Chris

+ 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. Devide by zero error
    By 4lowie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-09-2014, 10:23 AM
  2. [SOLVED] Devide Cel
    By ANDRE LE ROUX in forum Excel General
    Replies: 3
    Last Post: 07-19-2012, 06:05 AM
  3. How to Mutiply and Subtract Cells?
    By BenTenner in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 01-01-2009, 05:01 AM
  4. devide all...
    By Scripter in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-22-2007, 04:40 AM
  5. Mutiply
    By wei82 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-21-2007, 02:58 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