+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    03-10-2010
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2003
    Posts
    1

    getting the number format of a column

    Can anyone please tell me how you determine the number format applied to a column in VBA? I specifically want to know if the "Text" format has been applied (e.g. via Format->Cells->Number in Excel 2003).

  2. #2
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,213

    Re: getting the number format of a column

    Hi Chris, welcome to the forum.

    Cells have number formats, columns do not. You can loop through each cell in the column or a range and determine the NumberFormat property, though.

    Code:
    Sub numFmt()
    Dim ce as Range
    For each ce in Range("E1:E10")
        MsgBox ce.NumberFormat
    Next ce
    End Sub
    Any cell formatted as Text will return: @

    Hope that helps!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0