Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Jim Bennett
 
Posts: n/a
Default Find and Replace a Style

Can you find and replace a style in Excel?
  #2   Report Post  
Peter Ellis
 
Posts: n/a
Default

When you modify a style, Excel automatically applies the changes to all
styles in the workbook. You can copy the style if you want to save the
original.

"Jim Bennett" wrote:

Can you find and replace a style in Excel?

  #3   Report Post  
Jim Bennett
 
Posts: n/a
Default

Thanks for your post!
My problem is that I already have 2 styles in use in the spreadsheet and I
only want to use one of them. I have many cells using both styles and I want
them all to use just one. I am familiar with the procedure in Word but I
can't seem to find the same functionality in Excel.

"Peter Ellis" wrote:

When you modify a style, Excel automatically applies the changes to all
styles in the workbook. You can copy the style if you want to save the
original.

"Jim Bennett" wrote:

Can you find and replace a style in Excel?

  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

You could use a macro to loop through all the cells--or just the cells you're
using:

Option Explicit
Sub testme()

Dim myCell As Range
Dim myRng As Range

With ActiveSheet
Set myRng = .UsedRange
For Each myCell In myRng.Cells
If myCell.Style = "BadStyle" Then
myCell.Style = "GoodStyle"
End If
Next myCell
End With
End Sub

Replace badstyle and goodstyle with the styles you want.

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

Be aware that this code only looks at the used range--so if you applied a style
to a whole column, this macro would only do the change in the used range area
(between the top left cell of the worksheet (usually A1, but not always) and the
cell you get when you do ctrl-end).

Jim Bennett wrote:

Thanks for your post!
My problem is that I already have 2 styles in use in the spreadsheet and I
only want to use one of them. I have many cells using both styles and I want
them all to use just one. I am familiar with the procedure in Word but I
can't seem to find the same functionality in Excel.

"Peter Ellis" wrote:

When you modify a style, Excel automatically applies the changes to all
styles in the workbook. You can copy the style if you want to save the
original.

"Jim Bennett" wrote:

Can you find and replace a style in Excel?


--

Dave Peterson
  #5   Report Post  
Jim Bennett
 
Posts: n/a
Default

That is great Dave. I used it and it worked perfectly.
You also enlightened my on the ActiveSheet.UsedRange property!!

"Dave Peterson" wrote:

You could use a macro to loop through all the cells--or just the cells you're
using:

Option Explicit
Sub testme()

Dim myCell As Range
Dim myRng As Range

With ActiveSheet
Set myRng = .UsedRange
For Each myCell In myRng.Cells
If myCell.Style = "BadStyle" Then
myCell.Style = "GoodStyle"
End If
Next myCell
End With
End Sub

Replace badstyle and goodstyle with the styles you want.

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

Be aware that this code only looks at the used range--so if you applied a style
to a whole column, this macro would only do the change in the used range area
(between the top left cell of the worksheet (usually A1, but not always) and the
cell you get when you do ctrl-end).

Jim Bennett wrote:

Thanks for your post!
My problem is that I already have 2 styles in use in the spreadsheet and I
only want to use one of them. I have many cells using both styles and I want
them all to use just one. I am familiar with the procedure in Word but I
can't seem to find the same functionality in Excel.

"Peter Ellis" wrote:

When you modify a style, Excel automatically applies the changes to all
styles in the workbook. You can copy the style if you want to save the
original.

"Jim Bennett" wrote:

Can you find and replace a style in Excel?


--

Dave Peterson

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
find and replace steve Excel Discussion (Misc queries) 1 June 23rd 05 01:43 AM
Find and REPLACE within a selection, or column- not entire sheet/. smithers2002 Excel Worksheet Functions 4 April 21st 05 04:45 PM
Find and Replace - Quickest Option? Lindsey M Excel Worksheet Functions 1 March 8th 05 11:34 AM
find replace cursor default to find box luffa Excel Discussion (Misc queries) 0 February 3rd 05 12:11 AM
VB Find and Replace Bony_Pony Excel Worksheet Functions 10 December 6th 04 05:45 PM


All times are GMT +1. The time now is 02:18 PM.

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"