ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   getting a number format from a cell (https://www.excelbanter.com/excel-programming/348542-getting-number-format-cell.html)

Mike

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

Robert

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


Gary''s Student

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



All times are GMT +1. The time now is 04:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com