Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi... I was wondering if there is a way for visual basic to pick up an Excel cell's format properties like "Category" (general, currency, percentage, etc.) Also if the Category is set to "Number", can VB pick up the "Decimal places" property? Any help? Thanks! MJ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
have a look at the numberformat property of the range object -- Regards Frank Kabel Frankfurt, Germany MJ wrote: Hi... I was wondering if there is a way for visual basic to pick up an Excel cell's format properties like "Category" (general, currency, percentage, etc.) Also if the Category is set to "Number", can VB pick up the "Decimal places" property? Any help? Thanks! MJ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
MJ,
Activecell.numberformat will give you this in the same way that you would define it, or in the same way it shows in the "custom" section of the FormatNumber dialogue box. For example, format a cell to normal number format to two decimal places. In the immediate window, type: ?Activecell.Numberformat it should return "0.00". Change the format to four decimal places, check again and it will have changed to "0.0000". That should get you started. Cheers, Pete. -----Original Message----- Hi... I was wondering if there is a way for visual basic to pick up an Excel cell's format properties like "Category" (general, currency, percentage, etc.) Also if the Category is set to "Number", can VB pick up the "Decimal places" property? Any help? Thanks! MJ . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() That satisfies my needs... thanks guys! MJ -----Original Message----- MJ, Activecell.numberformat will give you this in the same way that you would define it, or in the same way it shows in the "custom" section of the FormatNumber dialogue box. For example, format a cell to normal number format to two decimal places. In the immediate window, type: ?Activecell.Numberformat it should return "0.00". Change the format to four decimal places, check again and it will have changed to "0.0000". That should get you started. Cheers, Pete. -----Original Message----- Hi... I was wondering if there is a way for visual basic to pick up an Excel cell's format properties like "Category" (general, currency, percentage, etc.) Also if the Category is set to "Number", can VB pick up the "Decimal places" property? Any help? Thanks! MJ . . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to format cells in Excel 2007 (i.e. currency format)? | Excel Discussion (Misc queries) | |||
How do I format cells to show date in Australian not US format? | Excel Worksheet Functions | |||
how do i format a cell based on format of a range of cells? | Excel Discussion (Misc queries) | |||
want format cells alignment not format cells font style | Excel Discussion (Misc queries) | |||
Cells won't convert to number format, even after format/cells/num. | Excel Discussion (Misc queries) |