+ Reply to Thread
Results 1 to 5 of 5

Excel macro to change text to numbers in a column

  1. #1
    Registered User
    Join Date
    05-07-2018
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    38

    Excel macro to change text to numbers in a column

    Hello,

    I have a query that pulls up a lot of information and puts it all into a sheet in my workbook. All of those sheets are formatted in text rather than numbers. I have a spreadsheet set up to do vlookups based on numbers that I type in. The vlookups dont work on plain text only on numbers. So I need to convert all of the text in a specific sheet to numbers. I can just do text to column on all of the columns and it fixes it, but the person who will use the spreadsheet isn't very knowledgeable with excel. Can I add a command like that to my query? Or maybe I can get a macro that activates when refreshing the query? I pasted my query below.

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    05-07-2018
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    38

    Re: Excel macro to change text to numbers in a column

    Ok so I just wanted to try to replace all of the text where it says "text" and i put "number" in it's place. How do you paste a query? JK it doesn't work because some of the columns have words in them and they cant be converted.
    Last edited by imperialzinc; 09-13-2018 at 12:27 PM.

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Excel macro to change text to numbers in a column

    Please attach a Excel sample file and detail clearly which columns to convert
    - Battle without fear gives no glory - Just try

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Excel macro to change text to numbers in a column

    If you have a column of numerals (strings rather than numbers) you can convert them to numbers using TextToColumns.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Registered User
    Join Date
    05-07-2018
    Location
    Chicago, IL
    MS-Off Ver
    2010
    Posts
    38

    Re: Excel macro to change text to numbers in a column

    I just recorded a macro that does text to column for each row in the spreadsheet. I wish I could just have the query mark numbers as numbers and text as text, but at least I have it working for now.

+ 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] Change and edit numbers in column with macro.
    By abjac in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-17-2014, 10:14 AM
  2. Replies: 4
    Last Post: 07-01-2012, 07:24 PM
  3. Macro to change text in a column
    By JoeB11 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-15-2009, 01:19 AM
  4. [SOLVED] How do I Change Numbers in text in MS-Excel
    By Yaman Mahajan in forum Excel General
    Replies: 2
    Last Post: 05-07-2006, 08:00 AM
  5. [SOLVED] Can I ignore numbers and sort only text in an Excel column?
    By justaMom in forum Excel General
    Replies: 5
    Last Post: 04-26-2006, 09:10 PM
  6. [SOLVED] In MS Excel, how do I change the column ref headers from numbers .
    By Bruce Lindfield in forum Excel General
    Replies: 1
    Last Post: 04-06-2005, 07:06 AM
  7. [SOLVED] how do I change case in an entire column of text in Excel
    By linpengie in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-31-2005, 08:06 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