How Do I Assign a Toolbar Button to a Custom Number Format I creat

P

Peo Sjoblom

Record a macro and save it to your personal.xls while applying the format,
would look something similar to

Option Explicit

Sub Macro1()
Selection.NumberFormat = "$#,##0_);[Red]($#,##0)"
End Sub

now edit it a bit and add 2 lines

Option Explicit

Sub Macro1()
Application.DisplayAlerts = False
Selection.NumberFormat = "$#,##0_);[Red]($#,##0)"
Application.DisplayAlerts = False
End Sub

now attach it to a custom button
 
G

Guest

Peo

Why is it choking on this line?

Selection.NumberFormat = "_(* #,##0.0_);_(* (#,##0.0);_(* " - "_);_(@_)"

Brett

Peo Sjoblom said:
Record a macro and save it to your personal.xls while applying the format,
would look something similar to

Option Explicit

Sub Macro1()
Selection.NumberFormat = "$#,##0_);[Red]($#,##0)"
End Sub

now edit it a bit and add 2 lines

Option Explicit

Sub Macro1()
Application.DisplayAlerts = False
Selection.NumberFormat = "$#,##0_);[Red]($#,##0)"
Application.DisplayAlerts = False
End Sub

now attach it to a custom button


--

Regards,

Peo Sjoblom


FuadsCurse said:
How do I assign a toolbar button to a custom number format I created?
 
P

Peo Sjoblom

Try this

Selection.NumberFormat = "_(* #,##0.0_);_(* (#,##0.0);_(* "" - ""_);_(@_)"



--

Regards,

Peo Sjoblom


FuadsCurse said:
Peo

Why is it choking on this line?

Selection.NumberFormat = "_(* #,##0.0_);_(* (#,##0.0);_(* " - "_);_(@_)"

Brett

Peo Sjoblom said:
Record a macro and save it to your personal.xls while applying the
format,
would look something similar to

Option Explicit

Sub Macro1()
Selection.NumberFormat = "$#,##0_);[Red]($#,##0)"
End Sub

now edit it a bit and add 2 lines

Option Explicit

Sub Macro1()
Application.DisplayAlerts = False
Selection.NumberFormat = "$#,##0_);[Red]($#,##0)"
Application.DisplayAlerts = False
End Sub

now attach it to a custom button


--

Regards,

Peo Sjoblom


FuadsCurse said:
How do I assign a toolbar button to a custom number format I created?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top