Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Question
I am a VB beginner and am looking for some code that I could use to change
cell shading from tan for all appliable cells in all of the worksheets to blue font. Does anyone have a script that I could use? Thank You! -- Drew |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Question
switch on the macro recorder
then from the menu Format / Styles / Modify / Patterns choose a color ok everythinmg then stop the recorder look at the code what you need will end up like this: Sub Macro1() With ActiveWorkbook.Styles("Normal").Interior .ColorIndex = 36 .PatternColorIndex = xlAutomatic .Pattern = xlSolid End With End Sub "Drew" wrote: I am a VB beginner and am looking for some code that I could use to change cell shading from tan for all appliable cells in all of the worksheets to blue font. Does anyone have a script that I could use? Thank You! -- Drew |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Question
Not faulting your code: but he seems to PERHAPS actually want to change font
to blue only in cells that have tan shading? Or maybe I'm reading too much into his request. "Patrick Molloy" wrote: switch on the macro recorder then from the menu Format / Styles / Modify / Patterns choose a color ok everythinmg then stop the recorder look at the code what you need will end up like this: Sub Macro1() With ActiveWorkbook.Styles("Normal").Interior .ColorIndex = 36 .PatternColorIndex = xlAutomatic .Pattern = xlSolid End With End Sub "Drew" wrote: I am a VB beginner and am looking for some code that I could use to change cell shading from tan for all appliable cells in all of the worksheets to blue font. Does anyone have a script that I could use? Thank You! -- Drew |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VB Question
no worries. I misunderstood the question
this code is perhaps what is required: Option Explicit Const cTAN As Long = 10079487 Sub Tan2Blue() Dim cell As Range Dim ws As Worksheet Application.ScreenUpdating = False For Each ws In ThisWorkbook.Worksheets Application.StatusBar = "checking " & ws.Name For Each cell In ws.UsedRange.Cells If cell.Interior.Color = cTAN Then cell.Font.Color = vbBlue End If Next Next Application.StatusBar = False Application.ScreenUpdating = True End Sub "JLatham" wrote: Not faulting your code: but he seems to PERHAPS actually want to change font to blue only in cells that have tan shading? Or maybe I'm reading too much into his request. "Patrick Molloy" wrote: switch on the macro recorder then from the menu Format / Styles / Modify / Patterns choose a color ok everythinmg then stop the recorder look at the code what you need will end up like this: Sub Macro1() With ActiveWorkbook.Styles("Normal").Interior .ColorIndex = 36 .PatternColorIndex = xlAutomatic .Pattern = xlSolid End With End Sub "Drew" wrote: I am a VB beginner and am looking for some code that I could use to change cell shading from tan for all appliable cells in all of the worksheets to blue font. Does anyone have a script that I could use? Thank You! -- Drew |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|