+ Reply to Thread
Results 1 to 5 of 5

Thread: Multiply range with constant and round results

  1. #1
    Registered User
    Join Date
    04-18-2011
    Location
    Bucuresti
    MS-Off Ver
    Excel 2007
    Posts
    64

    Multiply range with constant and round results

    Hi guys, I need a macro that will multiply all cells in a column and round the results.

    For example,

    A1:A30 is the range

    Constant is found in A33

    All cell in the range will be multiplied with A33 and the result should be rounded (it will be an int number). The result will overwrite the initial cell.

    Thanks for the help

  2. #2
    Forum Guru snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,151

    Re: Multiply range with constant and round results

        [A1:A30] = [index(int(A1:A30*A33),)]



  3. #3
    Registered User
    Join Date
    04-18-2011
    Location
    Bucuresti
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: Multiply range with constant and round results

    thank you for the quick reply snb, but unfortunately I don't know how to use that

  4. #4
    Forum Moderator Richard Buttrey's Avatar
    Join Date
    02-15-2008
    Location
    Grappenhall, UK
    MS-Off Ver
    Excel for Windows & Mac - all versions.
    Posts
    6,566

    Re: Multiply range with constant and round results

    Hi,

    ..or another approach

    Range("A33").Copy
    Range("A1:A30").PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply
    Richard Buttrey

    If this was useful then please rate it appropriately.

    Click the small star icon at the bottom left of my post.

  5. #5
    Registered User
    Join Date
    04-18-2011
    Location
    Bucuresti
    MS-Off Ver
    Excel 2007
    Posts
    64

    Re: Multiply range with constant and round results

    Range("A33").Copy
    Range("A1:A30").PasteSpecial Paste:=xlPasteAll, Operation:=xlMultiply
    this part i know, managed to do it with record macro

    normally it would be
     =ROUND((A1*A33);0)
    but this would mean the result is in a different cell
    Last edited by ciprian; 06-06-2011 at 05:01 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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.2.0