Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to change all cells with "zero" value into transparent, not bl

Hi, HELP!!! how to write code to change all cells with "zero" value into
transparent, "not blank",
I got the following from the Excel macro recorder, but it does not work, for
me :-)


Sub Macro1()
'
' Macro1 Macro
'
'
Range("A1:AA1000").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="0"
With Selection.FormatConditions(1).Font
.Bold = False
.Italic = False
.ColorIndex = 2
End With
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default How to change all cells with "zero" value into transparent, not bl

this may work for you

Sub test()
Dim rng As Range
Dim rngfound As Range
Application.ScreenUpdating = fasle
Application.Calculation = xlCalculationManual
Set rng = Range("A1:AA1000")
With rng
Set rngfound = .Find(What:="0", lookIn:=xlValues, LookAt:=xlWhole, _
searchorder:=xlByRows)
On Error Resume Next
If Not rngfound Is Nothing Then
firstaddress = rngfound.Address
Do
With rngfound
.Font.Bold = False
.Font.ColorIndex = 2
End With

Set rngfound = .FindNext(rngfound)
Loop While Not rngfound Is Nothing And rngfound.Address < _
firstaddress
End If
End With
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub


--


Gary


"AlanSimpson" wrote in message
...
Hi, HELP!!! how to write code to change all cells with "zero" value into
transparent, "not blank",
I got the following from the Excel macro recorder, but it does not work, for
me :-)


Sub Macro1()
'
' Macro1 Macro
'
'
Range("A1:AA1000").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="0"
With Selection.FormatConditions(1).Font
.Bold = False
.Italic = False
.ColorIndex = 2
End With
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default How to change all cells with "zero" value into transparent, no

don't know anything about foxpro

--


Gary


"AlanSimpson" wrote in message
...
Hi, Gary, thanks a lot. Could you make it work under Foxpro 5.0
environment ?


"Gary Keramidas" ??:

this may work for you

Sub test()
Dim rng As Range
Dim rngfound As Range
Application.ScreenUpdating = fasle
Application.Calculation = xlCalculationManual
Set rng = Range("A1:AA1000")
With rng
Set rngfound = .Find(What:="0", lookIn:=xlValues, LookAt:=xlWhole, _
searchorder:=xlByRows)
On Error Resume Next
If Not rngfound Is Nothing Then
firstaddress = rngfound.Address
Do
With rngfound
.Font.Bold = False
.Font.ColorIndex = 2
End With

Set rngfound = .FindNext(rngfound)
Loop While Not rngfound Is Nothing And rngfound.Address < _
firstaddress
End If
End With
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub


--


Gary


"AlanSimpson" wrote in message
...
Hi, HELP!!! how to write code to change all cells with "zero" value into
transparent, "not blank",
I got the following from the Excel macro recorder, but it does not work,
for
me :-)


Sub Macro1()
'
' Macro1 Macro
'
'
Range("A1:AA1000").Select
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlCellValue, Operator:=xlEqual, _
Formula1:="0"
With Selection.FormatConditions(1).Font
.Bold = False
.Italic = False
.ColorIndex = 2
End With
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
How do I change the column heading in Excel to display "A" "B" "C Thai New Users to Excel 1 November 30th 07 08:06 PM
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
Change default in input box from "20" to "000000"? Have macro continue on to name sheet tab? StargateFanFromWork[_4_] Excel Programming 7 October 29th 06 11:46 AM
Would like to change all "yes" cells in a worksheet with "logged" Kezza Excel Programming 5 May 10th 06 02:12 PM
=IF(D13="PAID","YES","NO") Can I change fonts colour Kev Excel Discussion (Misc queries) 3 February 17th 06 04:27 AM


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