Thread: Range Question
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Range Question

use:

Sheets(1).rg1.Interior.Color = vbYellow

instead of:

Sheets(1).Range("rg1").Interior.Color = vbYellow


You don't need RANGE() because rg1 is already a range
--
Gary''s Student - gsnu200764


"Roger Converse" wrote:

I have the following and am receiving a run time error 1004. Application
defined or Object Defined error.

What am I doing incorrectly?

Worksheets(1).Activate
If CheckBox1.Value = True Then
Set rg1 = Range("A17:F17")
Sheets(1).Range("rg1").Interior.Color = vbYellow
Else

I am trying to select the cells from A17 - F17 and highlight them yellow.

Thank you,
Roger