#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,203
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default 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
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
Newbie Question - Subtraction Formula Question [email protected] Excel Discussion (Misc queries) 3 May 5th 06 05:50 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good davegb Excel Programming 1 May 6th 05 06:35 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 27th 05 07:46 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 23 April 23rd 05 09:26 PM
Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you [email protected] Excel Programming 0 April 22nd 05 03:30 PM


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