+ Reply to Thread
Results 1 to 5 of 5

vba-multiply a range with number(text_box) and format range

  1. #1
    Registered User
    Join Date
    09-23-2007
    Posts
    29

    vba-multiply a range with number(text_box) and format range

    Hi,
    i have item Codes in ColumnA(A2:A500) and values in columnC (C2:C500)
    i need to multiply whole range in C with given number inputed by user.
    Additional to this, for few specified items (code: 123, 321, 231), the sign - or + needs to be converted -to+ or +to-
    (i am thinking of going with the form of somekind)
    Also, i need to format ColumnD with Text.

    Can this be done?
    thx in advance

  2. #2
    Valued Forum Contributor Excelenator's Avatar
    Join Date
    07-25-2006
    Location
    Wantagh, NY
    Posts
    333
    Here are a couple of examples of code that will accomplish the first two items on your list. AS for column D, I'm not sure what you are after.

    Please Login or Register  to view this content.
    ---------------------------------------------------
    ONLY APPLIES TO VBA RESPONSES WHERE APPROPRIATE
    To insert code into the VBE (Visual Basic Editor)
    1. Copy the code.
    2. Open workbook to paste code into.
    3. Right click any worksheet tab, select View Code
    4. VBE (Visual Basic Editor) opens to that sheets object
    5. You may change to another sheets object or the This Workbook object by double clicking it in the Project window
    6. In the blank space below the word "General" paste the copied code.

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525
    Quote Originally Posted by pinstripe
    Hi,
    i have item Codes in ColumnA(A2:A500) and values in columnC (C2:C500)
    i need to multiply whole range in C with given number inputed by user.
    Please Login or Register  to view this content.
    Additional to this, for few specified items (code: 123, 321, 231), the sign - or + needs to be converted -to+ or +to-
    Please Login or Register  to view this content.
    Also, i need to format ColumnD with Text.
    Please Login or Register  to view this content.
    Last edited by jindon; 11-10-2007 at 09:28 PM.

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229
    Since the multiplier is supplied by the user, it might be wise to put the product in its own column, so that the original numbers are preserved if the user changes their mind. (or bumps the Enter key when the multiplier = 0)

  5. #5
    Registered User
    Join Date
    09-23-2007
    Posts
    29
    thank you guys ... that solved the problem.
    now it looks so simple
    @mikerickson i need the results in same column, so this is ok
    thx

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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