Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default How do I create a customized toolbar button? Excell 2007

I would like to create button that would automatically change the format of a
cell's text or selected text to red with the strike through feature when I
clicked on it. How do I do that?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I create a customized toolbar button? Excell 2007

First, if you meant that you wanted to run a macro agains just a portion of text
in the cell, then that's not possible. But you could change the font color and
strikethrough for the whole cell.

I recorded a macro when I did one cell:

Option Explicit
Sub Macro1()
With Selection.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = True
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 3
End With
End Sub


Next I would edit it to keep just what I want:

Option Explicit
Sub Macro1()
With Selection.Font
.Strikethrough = True
.ColorIndex = 3
End With
End Sub

Then I'd give it a nice name:

Option Explicit
Sub RedAndStrikeThrough()
With Selection.Font
.Strikethrough = True
.ColorIndex = 3
End With
End Sub

Then back to excel.

Tools|macro|Macros...
Select that macro
click on Options
Give it a nice shortcut key combination

If you don't want the shortcut key, you can hit tools|macro|macros and select
your macro (hitting alt-f8 is a quick way to see that macro dialog).

And then test it out by selecting a range and hitting that shortcut key.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm



rllngriver wrote:

I would like to create button that would automatically change the format of a
cell's text or selected text to red with the strike through feature when I
clicked on it. How do I do that?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default How do I create a customized toolbar button? Excell 2007

ps. When you get lots of these macros and you don't want to use shortcut keys,
you can save them all into a dedicated workbook--and save it as an addin (so
that it's hidden from the user (you!) in excel).

But you have to give the user a way to run the macros.

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)



rllngriver wrote:

I would like to create button that would automatically change the format of a
cell's text or selected text to red with the strike through feature when I
clicked on it. How do I do that?


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6,582
Default How do I create a customized toolbar button? Excell 2007

Excel 2007 has lost the ability for the user to create commandbars. Third
party approaches have started popping up. Here's one:

http://pschmid.net/office2007/ribboncustomizer/

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Dave Peterson" wrote in message
...
ps. When you get lots of these macros and you don't want to use shortcut
keys,
you can save them all into a dedicated workbook--and save it as an addin
(so
that it's hidden from the user (you!) in excel).

But you have to give the user a way to run the macros.

For additions to the worksheet menu bar, I really like the way John
Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)



rllngriver wrote:

I would like to create button that would automatically change the format
of a
cell's text or selected text to red with the strike through feature when
I
clicked on it. How do I do that?


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,123
Default How do I create a customized toolbar button? Excell 2007

If you want to use the old commandbars code see my site for a few examples.

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Jon Peltier" wrote in message ...
Excel 2007 has lost the ability for the user to create commandbars. Third
party approaches have started popping up. Here's one:

http://pschmid.net/office2007/ribboncustomizer/

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Dave Peterson" wrote in message
...
ps. When you get lots of these macros and you don't want to use shortcut
keys,
you can save them all into a dedicated workbook--and save it as an addin
(so
that it's hidden from the user (you!) in excel).

But you have to give the user a way to run the macros.

For additions to the worksheet menu bar, I really like the way John
Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)



rllngriver wrote:

I would like to create button that would automatically change the format
of a
cell's text or selected text to red with the strike through feature when
I
clicked on it. How do I do that?


--

Dave Peterson





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default How do I create a customized toolbar button? Excell 2007

If you know the start and end points of the text within the cell you can use VBA
to give different fonts, sizes and colors within a cell.

Sub CellFont()
With ActiveCell.Characters(Start:=1, Length:=5).Font
.ColorIndex = 3
.Bold = True
.Underline = True
.Size = 14
End With
With ActiveCell.Characters(Start:=6, Length:=3).Font
.Superscript = True
.ColorIndex = 5
End With
With ActiveCell.Characters(Start:=10, Length:=4).Font
.Bold = True
.Size = 18
.ColorIndex = 6
End With
End Sub

Bu, as Dave says, not by selecting a portion of the text within the cell.


Gord Dibben MS Excel MVP

On Fri, 13 Apr 2007 07:03:55 -0500, Dave Peterson
wrote:

First, if you meant that you wanted to run a macro agains just a portion of text
in the cell, then that's not possible. But you could change the font color and
strikethrough for the whole cell.

I recorded a macro when I did one cell:

Option Explicit
Sub Macro1()
With Selection.Font
.Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = True
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 3
End With
End Sub


Next I would edit it to keep just what I want:

Option Explicit
Sub Macro1()
With Selection.Font
.Strikethrough = True
.ColorIndex = 3
End With
End Sub

Then I'd give it a nice name:

Option Explicit
Sub RedAndStrikeThrough()
With Selection.Font
.Strikethrough = True
.ColorIndex = 3
End With
End Sub

Then back to excel.

Tools|macro|Macros...
Select that macro
click on Options
Give it a nice shortcut key combination

If you don't want the shortcut key, you can hit tools|macro|macros and select
your macro (hitting alt-f8 is a quick way to see that macro dialog).

And then test it out by selecting a range and hitting that shortcut key.

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm



rllngriver wrote:

I would like to create button that would automatically change the format of a
cell's text or selected text to red with the strike through feature when I
clicked on it. How do I do that?


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 663
Default How do I create a customized toolbar button? Excell 2007

1. Do one of the following:
On the View menu, point to Toolbars, and then click Customize
-or-
Right click on the Top portion of excel, where the standard toolbars is
displayed and click customize.

2. In the Custimize dialog box, click the Command Tab,
3. In the Categories list, click Format.
4. In the Commands list to the right of the Categories list, click
Stikethrough button and drag and drop in the Formatting toolbar. and then
click Close button in the Customaize doalog box.

5. In the Formatting Tool bar, click the Font Color icon and select red.
6. Select any cell and then press the Fontsize button once and then the
Stirikethrough button next. You can repeat this to other cells.

Note: You can use the Format Painter button in the standard toolbar, to
apply the command.

Challa Prabhu

"rllngriver" wrote:

I would like to create button that would automatically change the format of a
cell's text or selected text to red with the strike through feature when I
clicked on it. How do I do that?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Saving customized toolbar and menus Min Excel Discussion (Misc queries) 2 April 13th 07 10:30 AM
How do you keep your toolbar customized the way you set it up? alitanna New Users to Excel 2 May 19th 06 08:20 AM
How do I create a button on the toolbar that will start my form? DMB Excel Discussion (Misc queries) 0 January 8th 06 11:00 PM
how to create a toolbar button to set selected cells to wrap text steveguebert Excel Discussion (Misc queries) 1 December 9th 05 12:34 AM
How can I save a customized Standard toolbar? TD Excel Discussion (Misc queries) 1 March 25th 05 07:06 PM


All times are GMT +1. The time now is 02:33 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"