PC Review


Reply
Thread Tools Rate Thread

How to change all cells with "zero" value into transparent, not bl

 
 
=?Utf-8?B?QWxhblNpbXBzb24=?=
Guest
Posts: n/a
 
      7th Dec 2006
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 With Quote
 
 
 
 
Gary Keramidas
Guest
Posts: n/a
 
      7th Dec 2006
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" <(E-Mail Removed)> wrote in message
news:6AB099DC-5284-4ECD-A255-(E-Mail Removed)...
> 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 With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      7th Dec 2006
don't know anything about foxpro

--


Gary


"AlanSimpson" <(E-Mail Removed)> wrote in message
news:41915CCD-C09C-4EC8-9CAF-(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
>> news:6AB099DC-5284-4ECD-A255-(E-Mail Removed)...
>> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
in Excel: How do I change "selected cells" highlight color? flameretired Microsoft Excel New Users 5 24th Jun 2009 08:39 PM
change "true" and "false" to "availble" and "out of stock" =?Utf-8?B?aW50aGVzdGFuZHM=?= Microsoft Excel Worksheet Functions 2 19th Jul 2007 07:05 PM
Cells formatted with "("@")" don't change when text pasted in (?). StargateFan Microsoft Excel Discussion 2 7th Apr 2007 11:15 PM
Would like to change all "yes" cells in a worksheet with "logged" Kezza Microsoft Excel Programming 5 10th May 2006 02:12 PM
ask for APIs about change smartphone mode like "Slient" ," Flight","OutDoor" Liren Zhao Microsoft Dot NET Compact Framework 5 3rd Jan 2005 11:53 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:06 AM.