+ Reply to Thread
Results 1 to 5 of 5

Convert Selection to Number Format

  1. #1
    Registered User
    Join Date
    08-20-2014
    Location
    san francisco, ca
    MS-Off Ver
    Excel2021
    Posts
    28

    Convert Selection to Number Format

    I have a data column (Column A) containing a mixture of (1) text (2) numbers formatted as text. I would like to extract only the data in Column A containing numbers and move the extracted array into Column F. Any thoughts?
    Attached Files Attached Files

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,619

    Re: Convert Selection to Number Format

    Try such code:
    Please Login or Register  to view this content.
    Note that output range is formatted as text before writing there data. Otherwise (with genral format), excel would write content of outarr as numbers (so 110 instead of 0110, etc.)
    Best Regards,

    Kaper

  3. #3
    Valued Forum Contributor
    Join Date
    04-01-2015
    Location
    The Netherlands
    MS-Off Ver
    2003/2007/2010/2016/office 365
    Posts
    880

    Re: Convert Selection to Number Format

    Without duplicate values

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Try this ‼


    As a VBA beginner starter without any loop but removing the duplicates :

    PHP Code: 
    Sub Demo1()
        
    Dim V
            V 
    Filter(Evaluate(Replace("TRANSPOSE(IF(ISERR(#*1),FALSE,#))""#", [A1].CurrentRegion.Address)), FalseFalse)
        If 
    UBound(V) > -1 Then
            With 
    [F2].Resize(UBound(V) + 1)
                .
    NumberFormat "@"
                
    .Value2 Application.Transpose(V)
                .
    RemoveDuplicates [{1}], xlNo
            End With
        End 
    If
    End Sub 
    ► Do you like it ? ► ► So thanks to click on bottom left star icon « Add Reputation » ! ◄ ◄

  5. #5
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Lightbulb Excel basics …


    As an obvious easy VBA beginner starter :

    PHP Code: 
    Sub Demo2()
            [
    D2].Formula "=NOT(ISERR(A2*1))"
        
    With ActiveSheet.UsedRange.Columns
            
    .Item(6).Clear
            
    .Item(1).AdvancedFilter xlFilterCopy, [D1:D2], [F1], True
        End With
            
    [D2].Clear
    End Sub 
    ► Do you like it ? ► ► So thanks to click on bottom left star icon « Add Reputation » ! ◄ ◄

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need formula or code to convert number(s) from custom format to number format
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-12-2015, 07:44 PM
  2. Replies: 1
    Last Post: 12-15-2014, 08:46 PM
  3. [SOLVED] How to convert any types format into Text with 5 digits in selection?
    By qzqzjcjp in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-20-2014, 02:15 PM
  4. Convert text to number on large, ambiguous selection
    By bbrunof in forum Excel General
    Replies: 1
    Last Post: 03-04-2014, 01:32 PM
  5. Convert date and time in serial number format to text format
    By nda13112 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-11-2013, 02:45 PM
  6. Excel: How to convert time format into number format that can be added?
    By Frances Jones in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-17-2012, 04:10 PM
  7. Convert numbers from text format to number format
    By merlin68 in forum Excel General
    Replies: 4
    Last Post: 04-12-2005, 09:06 AM

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