+ Reply to Thread
Results 1 to 2 of 2

macro to display formatting of an individual cell

Hybrid View

  1. #1
    Registered User
    Join Date
    09-03-2005
    Location
    Grand Canyon, AZ
    Posts
    7

    macro to display formatting of an individual cell

    Godd Evening All

    I am looking for code or a direction to show all the formatting attached to an individual cell. What I would like to do is select the cell and run a macro that would bring up a message or text box that displays a list of all the formatting (center, time, numeric, number of decimals, text wrap on/off, ETC ) attached to an individual cell. Excel stores the formatting of an individual cell somewhere (probably on an internal table), I would like to reference that table.

    If this question has been asked and answered somewhere on this forum, a gentle shove to the answer would be appreciated.

    Many thanks

    Paul

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,887
    This code will show you some of the information you can receive using a macro. There's lots more you can get, though..
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
        MsgBox "Cell Width: " & ActiveCell.ColumnWidth & vbCrLf & _
                "Font Color: " & ActiveCell.Font.Color & vbCrLf & _
                "Font Style: " & ActiveCell.Font.FontStyle & vbCrLf & _
                "Font Name: " & ActiveCell.Font.Name & vbCrLf & _
                "Cell Height: " & ActiveCell.Height, vbOKOnly, "Cell Characteristics"
    End Sub
    If you paste that into any sheet's code window, whenever you select another cell it will pop-up a message box telling you those characteristics. Obviously that would get old in a "live" spreadsheet, so you would probably link the macro to a keyboard shortcut or button, rather than the Worksheet's SelectionChange event.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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