+ Reply to Thread
Results 1 to 9 of 9

converting text to numbers in vba

  1. #1
    Forum Contributor
    Join Date
    09-18-2008
    Location
    india
    Posts
    158

    converting text to numbers in vba

    Hi Team,

    How can i convert text columns to numbers in VBA.

    Could someone advise how to do this.


    Regards,
    Shekar.
    Last edited by shekar goud; 04-20-2009 at 09:57 AM.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: converting text to numbers in vba

    If I understand you correctly this is one way
    It displays the result in a message box

    Please Login or Register  to view this content.
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: converting text to numbers in vba

    Quote Originally Posted by mudraker View Post
    If I understand you correctly this is one way
    It displays the result in a message box

    Please Login or Register  to view this content.
    I think you need to explain more clearly. Do you mean convert numbers stored as text to numbers?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: converting text to numbers in vba

    I tried the following funda, and it worked pretty fine for me. If it doesnt, then let me know the exact thing you are trying to do.

    Please Login or Register  to view this content.
    Thanks,
    Vikas

  5. #5
    Forum Contributor
    Join Date
    09-18-2008
    Location
    india
    Posts
    158

    Re: converting text to numbers in vba

    Hi All,

    Thanks for all your response.

    I just wanted to convert column "D" into numbers where i have numbers.When i trimed the column it converted into text problem is i have to vlookup that row which is giving #N/A.

    Regards,
    Shekar.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: converting text to numbers in vba

    Perhaps you can record a macro.

    After initiating the recording, select the column and go to Data|Text to Columns and click Finish.

    Stop the macro.

    Now you have a macro that you can attach to a button.

    If it is a rare use thing, it's just as easy to simply do the actions manually rather than have a macro...
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  7. #7
    Forum Contributor
    Join Date
    09-18-2008
    Location
    india
    Posts
    158

    Re: converting text to numbers in vba

    Hi All,

    Thanks again i have done this at the first i got the below.

    Please Login or Register  to view this content.
    when i did this as per your advise its wonder its worked really thanks to all.

    Please Login or Register  to view this content.

    It would be great if some guide me how do Vlookup with another file.

    Regards,
    Shekar.

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: converting text to numbers in vba

    It would be great if some guide me how do Vlookup with another file.
    You should post this question with examples etc, in a separate thread in the Excel Worksheet Functions forum.

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: converting text to numbers in vba

    Also please mark this thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ 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