+ Reply to Thread
Results 1 to 3 of 3

Convert to a Number using VBA

  1. #1
    Registered User
    Join Date
    11-22-2016
    Location
    United States
    MS-Off Ver
    XL 2010
    Posts
    18

    Question Convert to a Number using VBA

    I am looking to covert columns G:I (which may vary in length) from text to a number so that the columns will work with my excel formulas.

    I should be able to figure this out but am having difficulty getting it to work.

    Thank you!

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Convert to a Number using VBA

    Hi,

    The simplest way would be to enter a zero in a spare cell and copy it.

    Then select all the cells in G:I and use Paste Special Add.
    By adding zero to text 'numbers' you force them to become numbers proper.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Valued Forum Contributor PeteABC123's Avatar
    Join Date
    09-21-2012
    Location
    Chicago, IL
    MS-Off Ver
    MS Office 365 ver 2202
    Posts
    1,104

    Re: Convert to a Number using VBA

    Type a 1 into an empty cell.
    Copy.
    Highlight the range that you want to convert to a number.
    Paste special.
    Multiply.
    Click Ok.

    They're numbers now.

    Pete

+ 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. convert a negative number to a positive number by adding 49
    By khanaran in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-28-2016, 09:57 AM
  2. Should i convert string to number before comparing against a number or leave as is
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2015, 12:04 PM
  3. Replies: 1
    Last Post: 12-15-2014, 08:46 PM
  4. [SOLVED] convert decimal number to time : convert 1,59 (minutes, dec) to m
    By agenda9533 in forum Excel General
    Replies: 22
    Last Post: 09-15-2013, 10:43 AM
  5. Replies: 1
    Last Post: 10-28-2012, 05:42 AM
  6. Replies: 1
    Last Post: 07-29-2005, 04:05 PM
  7. [SOLVED] not able to convert text, or graphic number to regular number in e
    By knutsenk in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-02-2005, 04:14 AM

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