+ Reply to Thread
Results 1 to 4 of 4

Macro reads 3 digit #'s but not 4 digit #'s

  1. #1
    Forum Contributor
    Join Date
    12-28-2006
    MS-Off Ver
    2010
    Posts
    118

    Macro reads 3 digit #'s but not 4 digit #'s

    Hello,
    This is a Macro that was made by Leith Ross which works great for the most part but the problem I am having is it only works if the #'s in A & C are 3 digits (change A2 and C2 to 660 to see what I am talking about) how do I get this macro to work for 4 digit numbers?
    Attached Files Attached Files

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    PJ.. I found the problem..

    Your data in columns A and C probably aren't being read as numbers. They're both set to 'General' formatting, but it appears 'General' isn't treating them equally.

    Put the number 1 in an empty cell on Sheet1. Select the cell and copy it (CTRL+C or Edit-Copy). Select all of your data in column A (don't go beyond the end of your data, though). Click Edit-PasteSpecial-Multiply.

    Now select all of your data in column C (the cell with 1 in it should still be flashing). Again, don't select rows below your data in column C. Click Edit-PasteSpecial-Multiply.

    This will convert any 'numbers stored as text' to numeric in Excel's eyes. Delete the cell with the 1 in it. Finally, run your macro. It should work as you intended. It did for me, at least.

    UPDATE: Actually, it is just column C's values that are messed up. No need to PasteSpecial/Multiply against column A.
    Last edited by Paul; 03-17-2007 at 12:13 AM.

  3. #3
    Forum Contributor
    Join Date
    12-28-2006
    MS-Off Ver
    2010
    Posts
    118
    Quote Originally Posted by pjoaquin
    PJ.. I found the problem..

    Your data in columns A and C probably aren't being read as numbers. They're both set to 'General' formatting, but it appears 'General' isn't treating them equally.

    Put the number 1 in an empty cell on Sheet1. Select the cell and copy it (CTRL+C or Edit-Copy). Select all of your data in column A (don't go beyond the end of your data, though). Click Edit-PasteSpecial-Multiply.

    Now select all of your data in column C (the cell with 1 in it should still be flashing). Again, don't select rows below your data in column C. Click Edit-PasteSpecial-Multiply.

    This will convert any 'numbers stored as text' to numeric in Excel's eyes. Delete the cell with the 1 in it. Finally, run your macro. It should work as you intended. It did for me, at least.

    UPDATE: Actually, it is just column C's values that are messed up. No need to PasteSpecial/Multiply against column A.
    PERFECT THANK YOU!!!

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Glad I could help.

+ 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