Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Replaceformat problem

I have a macro which worked perfectly this morning which replaced values with
the same value and replaced the interior colour depending on the value within
the cell. I added a select statement with the with the selection of "" to be
replaced by "" and the search to be xlNone. This did not produce the desired
result and so I removed this piece of code. The problem now is that no
colour changes occur in the spreadsheet although the code is the same. Has
anyone came across this problem?

I have added the relevant code below.
Thanks in advance
Davie
Sub EDITcolumnSCORES()


Columns("h:m").Select
Selection.ColumnWidth = 8
Selection.Font.Bold = True
With Selection.Font
.Name = "Arial"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Application.ReplaceFormat.Interior.ColorIndex = 1
Application.ReplaceFormat.Font.ColorIndex = 2
Application.ReplaceFormat.Orientation = 90
Selection.Replace What:="Crystalised", Replacement:="Crystalised",
Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 10
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="H", Replacement:="H", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 45
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="MH", Replacement:="MH", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 6
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="ML", Replacement:="ML", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 4
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="L", Replacement:="L", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Replaceformat problem

This problem seems to have been machine specific. The macro works fine
today. Don't you think computing is wonderfull!!!

"davethewelder" wrote:

I have a macro which worked perfectly this morning which replaced values with
the same value and replaced the interior colour depending on the value within
the cell. I added a select statement with the with the selection of "" to be
replaced by "" and the search to be xlNone. This did not produce the desired
result and so I removed this piece of code. The problem now is that no
colour changes occur in the spreadsheet although the code is the same. Has
anyone came across this problem?

I have added the relevant code below.
Thanks in advance
Davie
Sub EDITcolumnSCORES()


Columns("h:m").Select
Selection.ColumnWidth = 8
Selection.Font.Bold = True
With Selection.Font
.Name = "Arial"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Application.ReplaceFormat.Interior.ColorIndex = 1
Application.ReplaceFormat.Font.ColorIndex = 2
Application.ReplaceFormat.Orientation = 90
Selection.Replace What:="Crystalised", Replacement:="Crystalised",
Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 10
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="H", Replacement:="H", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 45
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="MH", Replacement:="MH", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 6
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="ML", Replacement:="ML", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 4
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="L", Replacement:="L", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True

End Sub


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 62
Default Replaceformat problem

It's working fine now.

"davethewelder" wrote:

I have a macro which worked perfectly this morning which replaced values with
the same value and replaced the interior colour depending on the value within
the cell. I added a select statement with the with the selection of "" to be
replaced by "" and the search to be xlNone. This did not produce the desired
result and so I removed this piece of code. The problem now is that no
colour changes occur in the spreadsheet although the code is the same. Has
anyone came across this problem?

I have added the relevant code below.
Thanks in advance
Davie
Sub EDITcolumnSCORES()


Columns("h:m").Select
Selection.ColumnWidth = 8
Selection.Font.Bold = True
With Selection.Font
.Name = "Arial"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = 1
End With
Application.ReplaceFormat.Interior.ColorIndex = 1
Application.ReplaceFormat.Font.ColorIndex = 2
Application.ReplaceFormat.Orientation = 90
Selection.Replace What:="Crystalised", Replacement:="Crystalised",
Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 10
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="H", Replacement:="H", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 45
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="MH", Replacement:="MH", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 6
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="ML", Replacement:="ML", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True
Application.ReplaceFormat.Interior.ColorIndex = 4
Application.ReplaceFormat.Font.ColorIndex = 1
Application.ReplaceFormat.Orientation = 0
Selection.Replace What:="L", Replacement:="L", Lookat:=xlWhole, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=True

End Sub


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
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
problem with a conditional max problem Brian Cornejo Excel Discussion (Misc queries) 1 February 18th 05 06:25 PM


All times are GMT +1. The time now is 09:19 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"