+ Reply to Thread
Results 1 to 4 of 4

Problem creating a macro to convert numbers which are stored as text

  1. #1
    Registered User
    Join Date
    07-10-2008
    Location
    Norwich, England
    MS-Off Ver
    Office XP
    Posts
    15

    Exclamation Problem creating a macro to convert numbers which are stored as text

    Sometimes when you paste data from a Microsoft Access table into an Excel spreadsheet you get little green triangles in the top left-hand corner of the numeric cells. When you click on it, it says that the number is stored as text, and then there is an option to convert it to number. At the moment, I have to highlight all the affected cells and then click the option to convert them to numbers. Is there any way I can write a macro to automatically convert all the cells in a given column to number?

    This is what I've tried so far:
    If I highlight all the affected cells and go to the Format Cells dialog box and select Number from the Category list, it doesn't get rid of the green triangles.

    The reason I am bothered about this is because it means the Vlookups in my spreadsheet aren't working - it seems that the Vlookups are trying to find numbers, but because the numbers are stored as text, it isn't recognising them. Therefore, all the Vlookups are returning #N/A.

    This is a regular process, so it would be good if there was an automated solution to the problem of the numbers being stored as text. I can't change the data formats directly in Access, as this would affect other data.

    Does anyone have any ideas on how to resolve this? Thank you in advance for any help.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Try selecting the cells and then running this code:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-10-2008
    Location
    Norwich, England
    MS-Off Ver
    Office XP
    Posts
    15
    Thank you for your suggestion - it works a treat!

  4. #4
    Registered User
    Join Date
    09-12-2012
    Location
    Wrexham
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Problem creating a macro to convert numbers which are stored as text

    Worked for me to! Simples!! Thanks!!!

+ 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 Text to a Number - VB Code Needed
    By SEOT in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-28-2008, 06:21 PM
  2. Convert cell containing numbers as text into a sum...
    By Stevie-B in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-10-2008, 11:52 AM
  3. Column Has Text and Numbers, Need To SUMIF Only Numbers
    By Karleajensar in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-04-2008, 01:27 PM
  4. Save Macro Problem (Digital Signature)
    By JPH-PCCoor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-29-2007, 11:16 AM
  5. macro issue with numbers
    By exceldoofus in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-23-2006, 01:10 PM

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