Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Macro to copy data containing numeric values

  1. #11
    Administrator Excel Fox's Avatar
    Join Date
    Mar 2011
    Posts
    1,402
    Rep Power
    10
    A slightly more slower, but shorter one that uses the same technique. Replace the line in the HasNumber function with the following. Note: Though it looks shorter, the original code should be faster. Having said that, if the data isn't too large, then the difference should be very minimal.

    Code:
    HasNumber = Evaluate("MAX(IFERROR(FIND(ROW(1:10)-1,""" & varValue & """),0))")
    EDIT: Note that this will only work in Excel 2007 and above because I've used the IFERROR function. If you are familiar with formulas, and you want to make it compatible with Excel 2003 and before, just modify the above formula. Post back in case you are using an older version of Excel, not sure how to edit the formula I've used.
    Last edited by Excel Fox; 04-05-2014 at 08:40 PM. Reason: Additional Info
    A dream is not something you see when you are asleep, but something you strive for when you are awake.

    It's usually a bad idea to say that something can't be done.

    The difference between dream and aim, is that one requires soundless sleep to see and the other requires sleepless efforts to achieve

    Join us at Facebook

  2. #12
    Member
    Join Date
    Aug 2012
    Posts
    40
    Rep Power
    0
    Hi Excel Fox

    Thanks it works perfectly

    Flupsie

Similar Threads

  1. Replies: 0
    Last Post: 04-20-2013, 10:07 AM
  2. Macro to copy data in specific Columns
    By Howardc in forum Excel Help
    Replies: 0
    Last Post: 04-19-2013, 10:42 AM
  3. Extracting Numeric Values From Alphanumeric Text
    By Safal Shrestha in forum Excel Help
    Replies: 3
    Last Post: 03-21-2013, 12:04 PM
  4. Macro to copy data from a set of excel files
    By Sreejesh Menon in forum Excel Help
    Replies: 5
    Last Post: 11-15-2012, 11:17 AM
  5. Replies: 2
    Last Post: 11-08-2012, 01:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •