Thread: Format Cells
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Format Cells

In fact, instead of applying the number format a cell at a time, you could just
get the whole selection at once:

Sub NumFormat2()
Selection.NumberFormat = "[$Indonesian Rupiah] #,##0.00"
End Sub

Gord Dibben wrote:

As you have found, custom formats are saved with that workbook only.

You could write a macro for the custom format and assign the macro to a button
on a toolbar.

Sub NumFormat()
Dim cel As Range
On Error GoTo endit
For Each cel In Selection
cel.NumberFormat = "[$Indonesian Rupiah] #,##0.00"
Next cel
Exit Sub
endit:
MsgBox "No cells found!"
End Sub

Save the macro in Personal.xls.

Alternative would be create a workbook template with the custom format and use
that template as the basis for all new workbooks.

Existing workbooks would not be affected and would have to be changed on an
individual case.

See this google thread for more info.

http://tinyurl.com/37fmzz

Gord Dibben MS Excel MVP

On Thu, 17 Jan 2008 12:19:01 -0800, GKW in GA
wrote:

It rembers them in the document they were created in, but if you create a
custom format in one document and then want to use it in another document,
then you have to create it over again, which is what I am trying to avoid

I have Excel 2003

"Fred Smith" wrote:

First, you can select a range of cells, then apply the format to the entire
range.

Second, Excel remembers custom formats that you have entered, so you can
just pick the previously entered format from the list.

What version of Excel are you using?

Regards,
Fred

"GKW in GA" wrote in message
...
I use a custom format for cells quite frequently by going to FORMAT | CELLS
|NUMBER | CUSTOM and then specifying the format.

Is there any way to save a custom format for a cell. I use the same custom
format a lot and have to re-key it all the time



--

Dave Peterson