+ Reply to Thread
Results 1 to 9 of 9

Multiply cells in an area by 1000

  1. #1
    Forum Contributor
    Join Date
    12-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    232

    Wink Multiply cells in an area by 1000

    Good Afternoon!!

    I have learned quite a bit about excel from this forum! But now I'm stuck and I need help. I am new to VBA and I've tried to learn solo and it has not worked out. Let me tell you want I'm trying to do:

    Cells A3-AB23 are imput and need to be muliplied by 1000. Now I have found the code to do an entire worksheet, but I cannot edit it to a range cells.

    I'm very excited and cannot wait to see what it is supposed to look like!

    Thanks in advance!

    I love execl and this is such fun to learn!

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Multiply cells in an area by 1000

    nemo74,

    Welcome to the Excel Forum.


    The below macro completed the task in 0.031 seconds on my Lenovo T61 laptop computer.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Open your workbook
    3. Press the keys ALT + F11 to open the Visual Basic Editor
    4. Press the keys ALT + I to activate the Insert menu
    5. Press M to insert a Standard Module
    6. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    7. Press the keys ALT + Q to exit the Editor, and return to Excel
    8. To run the macro from Excel, open the workbook, and press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.


    Please Login or Register  to view this content.

    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm


    Then run the MultiplyRangeBy1000 macro.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Forum Contributor
    Join Date
    12-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    232

    Re: Multiply cells in an area by 1000

    Wow That is not even close to what I Thought it would look like. This looks like it will adjust eveything that is in the range I named. Is there anyway to make it dynamic so any other numbers I put in say AC3:AZ23 will auto multiply themselved?

    Thanks so much thus far!

  4. #4
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Multiply cells in an area by 1000

    nemo74,

    Here is another macto, where you can select at least 2 consecutive cells, and the selected cells will be multiplied by 1000.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).


    Please Login or Register  to view this content.

    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm


    Then run the MultiplySelectionBy1000 macro.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Multiply cells in an area by 1000

    Another way:

    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Contributor
    Join Date
    12-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    232

    Thumbs up Re: Multiply cells in an area by 1000

    Thanks all, From what you have posted here and what I thought it would look like, I found another way:

    Please Login or Register  to view this content.
    You guys are awesome! Thanks for your help so so much.

  7. #7
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Multiply cells in an area by 1000

    nemo74,

    Thanks for the feedback.

    You are very welcome. Glad we could help.

    Come back anytime.

  8. #8
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Multiply cells in an area by 1000

    I found another way:
    That will generate a runtime error if more than one cell is modified.

  9. #9
    Forum Contributor
    Join Date
    12-11-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    232

    Re: Multiply cells in an area by 1000

    Quote Originally Posted by shg View Post
    That will generate a runtime error if more than one cell is modified.
    I'm not sure when that will happen. I have used it so far to assit me in filling out a bunch. I even exteneded the range and I don't get an error. Since I know I'm MEGA new to VBA, it could be I have not done something that should trigger it.

    I'm just using it as I enter the data value to *1000 for the cells in that range. It saved fine, opens fine so I'm not sure.

+ 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.6.0 RC 1