close

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

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 = quot;$#,##0_);[Red]($#,##0)quot;
End Sub

now edit it a bit and add 2 lines

Option Explicit

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

now attach it to a custom button--

Regards,

Peo Sjoblomquot;FuadsCursequot; gt; wrote in message
...
gt; How do I assign a toolbar button to a custom number format I created?
Peo

Why is it choking on this line?

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

Brett

quot;Peo Sjoblomquot; wrote:

gt; Record a macro and save it to your personal.xls while applying the format,
gt; would look something similar to
gt;
gt; Option Explicit
gt;
gt; Sub Macro1()
gt; Selection.NumberFormat = quot;$#,##0_);[Red]($#,##0)quot;
gt; End Sub
gt;
gt; now edit it a bit and add 2 lines
gt;
gt; Option Explicit
gt;
gt; Sub Macro1()
gt; Application.DisplayAlerts = False
gt; Selection.NumberFormat = quot;$#,##0_);[Red]($#,##0)quot;
gt; Application.DisplayAlerts = False
gt; End Sub
gt;
gt; now attach it to a custom button
gt;
gt;
gt; --
gt;
gt; Regards,
gt;
gt; Peo Sjoblom
gt;
gt;
gt; quot;FuadsCursequot; gt; wrote in message
gt; ...
gt; gt; How do I assign a toolbar button to a custom number format I created?
gt;
gt;
gt;

Try this

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

Regards,

Peo Sjoblomquot;FuadsCursequot; gt; wrote in message
...
gt; Peo
gt;
gt; Why is it choking on this line?
gt;
gt; Selection.NumberFormat = quot;_(* #,##0.0_);_(* (#,##0.0);_(* quot; - quot;_);_(@_)quot;
gt;
gt; Brett
gt;
gt; quot;Peo Sjoblomquot; wrote:
gt;
gt;gt; Record a macro and save it to your personal.xls while applying the
gt;gt; format,
gt;gt; would look something similar to
gt;gt;
gt;gt; Option Explicit
gt;gt;
gt;gt; Sub Macro1()
gt;gt; Selection.NumberFormat = quot;$#,##0_);[Red]($#,##0)quot;
gt;gt; End Sub
gt;gt;
gt;gt; now edit it a bit and add 2 lines
gt;gt;
gt;gt; Option Explicit
gt;gt;
gt;gt; Sub Macro1()
gt;gt; Application.DisplayAlerts = False
gt;gt; Selection.NumberFormat = quot;$#,##0_);[Red]($#,##0)quot;
gt;gt; Application.DisplayAlerts = False
gt;gt; End Sub
gt;gt;
gt;gt; now attach it to a custom button
gt;gt;
gt;gt;
gt;gt; --
gt;gt;
gt;gt; Regards,
gt;gt;
gt;gt; Peo Sjoblom
gt;gt;
gt;gt;
gt;gt; quot;FuadsCursequot; gt; wrote in message
gt;gt; ...
gt;gt; gt; How do I assign a toolbar button to a custom number format I created?
gt;gt;
gt;gt;
gt;gt;

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()