+ Reply to Thread
Results 1 to 2 of 2

Multiply all cells in a row by variable

  1. #1
    Registered User
    Join Date
    10-10-2003
    Location
    Massachusetts
    MS-Off Ver
    Office 365
    Posts
    88

    Multiply all cells in a row by variable

    We are always looking for a way to do things more quickly.
    We can do what we want to we can do one cell at a time with a loop. Very slow. It doesn't seem like we should have to work our way 1 cell at a time across a row. What we really want to do is select an entire row of cells and multiply the contents of each cell by the same Variable.

    There are a hundred rows in the table ( I know not that big.) 20 columns wide. Just watching the macro run one cell at a time across a row, then down to the next row only to repeat cell by cell with an updated variable unique for that row makes us feel that we are not performing the operation in an efficient manner.

    We didn't upload a sheet because so few cells are needed to demonstrate.

    Note: We could enter the value for sngA into a cell prior to performing the calcultation

    Please Login or Register  to view this content.
    We know the above code is silly. We just want to give an idea of what we're trying (foolishly?) to do.

    So.... The bottom line is whether or not working our way across the row cell by cell is the only way to accomplish the task. It just feels that there has to be a way to perform the multiplication across multiple cells at once .

    As always - Thanks to all who look.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Multiply all cells in a row by variable

    You can Copy, Paste Special with Multiply.


    Please Login or Register  to view this content.
    You did not show how sngA was derived, or used other than to set it to a constant, so I didn't use it.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ 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: 15
    Last Post: 08-11-2019, 09:52 PM
  2. Replies: 12
    Last Post: 12-30-2017, 10:35 AM
  3. [SOLVED] How to multiply matching 2 cells with 2 different cells of 2 different table
    By k rabbi in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-07-2016, 03:31 PM
  4. Hwo Do You Multiply a Variable by a Value in a Cell
    By glennchung in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-29-2014, 07:47 PM
  5. Multiply two cells based on information in two other cells
    By stanster in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-15-2012, 10:04 AM
  6. Replies: 3
    Last Post: 02-01-2012, 04:21 PM
  7. How to multiply 2 columns with variable range?
    By Wino in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-05-2009, 09:55 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