Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,101
Default getting a number format from a cell

How do I get the number format from a given cell?

Range("E8").Select
str = Selection.NumberFormat

Thanks
Mike
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 193
Default getting a number format from a cell

str = Selection.Cells.NumberFormat

"Mike" wrote:

How do I get the number format from a given cell?

Range("E8").Select
str = Selection.NumberFormat

Thanks
Mike

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default getting a number format from a cell

Mike:

If you need to see the format, then:

Sub Macro1()
Dim str As String
str = Selection.Cells.NumberFormat
MsgBox (str)
End Sub


will display it.
--
Gary''s Student


"Robert" wrote:

str = Selection.Cells.NumberFormat

"Mike" wrote:

How do I get the number format from a given cell?

Range("E8").Select
str = Selection.NumberFormat

Thanks
Mike

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
format cell custom Number format Dan Excel Worksheet Functions 2 January 26th 10 05:29 PM
Format cell to Number David R. S. Excel Discussion (Misc queries) 14 August 17th 09 04:03 PM
Cell Number format Lamb Chop Excel Discussion (Misc queries) 3 July 25th 06 11:29 PM
Format a cell with a custom number format Armor Excel Worksheet Functions 4 January 29th 06 11:25 PM
Number format based on number format of another cell in another workbook Rob Excel Programming 9 January 9th 05 04:30 PM


All times are GMT +1. The time now is 05:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"