Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Evaluate cell in range and change cell attribute

I've been working on the following code, but get an error on the
designated line - can someone help?

Dim rCell As Range
Sheets("Form").Select
Range("B2:C450").Select
For Each rCell In Selection.Cells
If rCell.Interior.ColorIndex = 35 And rCell.Value = "" Then <---
ERROR OCCURS
rCell.Borders.Color = 3
End If
Next rCell
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Evaluate cell in range and change cell attribute

What error because there's nothing wrong with the code

Mike

"S Himmelrich" wrote:

I've been working on the following code, but get an error on the
designated line - can someone help?

Dim rCell As Range
Sheets("Form").Select
Range("B2:C450").Select
For Each rCell In Selection.Cells
If rCell.Interior.ColorIndex = 35 And rCell.Value = "" Then <---
ERROR OCCURS
rCell.Borders.Color = 3
End If
Next rCell

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Evaluate cell in range and change cell attribute

I get a type mismatch

if I put this line I still get an object error

If rCell.Interior.ColorIndex = 35 And rCell.Value Is Null Then

Not sure what is going on...humm...



On Apr 9, 5:04*pm, Mike H wrote:
What error because there's nothing wrong with the code

Mike



"S Himmelrich" wrote:
I've been working on the following code, but get an error on the
designated line - can someone help?


* Dim rCell As Range
* * *Sheets("Form").Select
* * *Range("B2:C450").Select
* For Each rCell In Selection.Cells
* * If rCell.Interior.ColorIndex = 35 And rCell.Value = "" Then *<---
ERROR OCCURS
* * * rCell.Borders.Color = 3
* * * End If
* Next rCell- Hide quoted text -


- Show quoted text -


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Evaluate cell in range and change cell attribute

That's different than the code you posted yesterday when you were using ""

try this line

If rCell.Interior.ColorIndex = 35 And IsNull(rCell.Value) Then

Mike

"S Himmelrich" wrote:

I get a type mismatch

if I put this line I still get an object error

If rCell.Interior.ColorIndex = 35 And rCell.Value Is Null Then

Not sure what is going on...humm...



On Apr 9, 5:04 pm, Mike H wrote:
What error because there's nothing wrong with the code

Mike



"S Himmelrich" wrote:
I've been working on the following code, but get an error on the
designated line - can someone help?


Dim rCell As Range
Sheets("Form").Select
Range("B2:C450").Select
For Each rCell In Selection.Cells
If rCell.Interior.ColorIndex = 35 And rCell.Value = "" Then <---
ERROR OCCURS
rCell.Borders.Color = 3
End If
Next rCell- Hide quoted text -


- Show quoted text -



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 76
Default Evaluate cell in range and change cell attribute

Thank you for your response, this didn't work either.

On Apr 10, 6:13*am, Mike H wrote:
That's different than the code you posted yesterday when you were using ""

try this line

If rCell.Interior.ColorIndex = 35 And IsNull(rCell.Value) Then

Mike



"S Himmelrich" wrote:
I get a type mismatch


if I put this line I still get an object error


* * If rCell.Interior.ColorIndex = 35 And rCell.Value Is Null Then


Not sure what is going on...humm...


On Apr 9, 5:04 pm, Mike H wrote:
What error because there's nothing wrong with the code


Mike


"S Himmelrich" wrote:
I've been working on the following code, but get an error on the
designated line - can someone help?


* Dim rCell As Range
* * *Sheets("Form").Select
* * *Range("B2:C450").Select
* For Each rCell In Selection.Cells
* * If rCell.Interior.ColorIndex = 35 And rCell.Value = "" Then *<---
ERROR OCCURS
* * * rCell.Borders.Color = 3
* * * End If
* Next rCell- Hide quoted text -


- Show quoted text -- Hide quoted text -


- Show quoted text -


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
Caption attribute at Cell in Excel XML dob_xml Excel Discussion (Misc queries) 0 November 27th 06 12:05 PM
Evaluate Range of Cell halem2[_82_] Excel Programming 2 July 3rd 06 04:51 PM
How to write vba to evaluate the text font and size on an active cell range? Paul Excel Programming 2 February 20th 06 08:48 PM
Push value to a cell attribute? G Lykos Excel Programming 4 November 22nd 05 04:00 AM
Change cell colour for a cell or range within a predefined range Martin[_21_] Excel Programming 2 May 23rd 05 06:16 PM


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