+ Reply to Thread
Results 1 to 7 of 7

convert to number macro

  1. #1
    Registered User
    Join Date
    08-08-2014
    Location
    Here and There
    MS-Off Ver
    2010
    Posts
    25

    convert to number macro

    Hi guys,
    I am working with a report that has a column of number in a text format.
    If you are working with it manually, you can click on the exclamation mark and then convert it to number.
    I tried to record a macro with this action, but the macro just records the selecting of the cell.

    What is the code to convert the whole column to regular numbers?
    By the way, selecting a cell and changing the format to number through the ribbon does not help, it still requires to click the convert to number.

    Thanks!
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: convert to number macro

    Have you tried to just type in cell b1
    =value(A1)

    This will change the text to values. You can then copy and paste as values once you've converted to values
    Happy with my advice? Click on the * reputation button below

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: convert to number macro

    try too
    Please Login or Register  to view this content.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: convert to number macro

    Hi, niukvba,

    code may look like this:
    Please Login or Register  to view this content.
    How to install your new code
    1. Copy the Excel VBA code
    2. Select the workbook in which you want to store the Excel VBA code
    3. Press Alt+F11 to open the Visual Basic Editor
    4. Choose Insert > Module
    5. Edit > Paste the macro into the module that appeared
    6. Close the VBEditor
    7. Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)

    To run the Excel VBA code:
    1. Press Alt-F8 to open the macro list
    2. Select a macro in the list
    3. Click the Run button
    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: convert to number macro

    Maybe:

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-08-2014
    Location
    Here and There
    MS-Off Ver
    2010
    Posts
    25

    Re: convert to number macro

    Thank you all!
    This is solved. The moderator explained me once how to mark a thread a s solved, but I can't find this option..

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: convert to number macro

    Hi, niukvba,

    itīs on the very start of the FAQ:
    Mark Your Thread Solved
    To mark your thread solved do the following:
    New Method
    -Go to the top of the first post
    -Select Thread Tools
    -Select Mark thread as Solved

    Old Method
    - Go to the first post
    - Click edit
    - Click Advance
    - Just below the word "Title:" you will see a dropdown with the word No prefix.
    - Change to Solve
    - Click Save
    Ciao,
    Holger

+ 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. [SOLVED] Macro to convert text number to digital number
    By Patish in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2014, 07:43 AM
  2. [SOLVED] VBA Macro to convert text to number
    By Pho6 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-13-2013, 02:04 AM
  3. Macro to convert text to number
    By Wgmoneill in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2012, 02:12 PM
  4. [SOLVED] error convert to number macro
    By cherrynich in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-19-2006, 09:30 AM
  5. Convert a number formatted as text to a number in a macro
    By MACRE0 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-21-2005, 09:51 PM

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