ColorIndex ...

J

jlarkin

Hi,

I'm looking to run a macro that references another Sheet.

If the Name, say, DAN shows up in cell C8 and the CELL color = 41
then activesheet.range(a1) colorindex = 41

if the name DAN shows up in cell C8 and the CELL color = 6
then activesheet.range(a1) colorindex = 6

and so on and so on.

But I'll be damned if I cant figure it out. I'm working on it as a sid
project for my boss... If anyone can help me out, that'd be great.

-jlarkin
 
F

Frank Kabel

Hi
do you mean

sub foo()
dim source_wks as worksheet
dím target_wks as worksheet

set source_wks = worksheets("other_sheet")
set target_wks=activesheet

with source_wks.range("C8")
if .value="DAN" then
target_wks.range("A1").interior.colorindex=.interior.colorindex
end if
end with
end sub
 
D

Don Guillett

try
if range("c8")="Dan" and range("c8").interior.colorindex=6 then
range("a1".interior.colorindex=41
end if

You didn't say anything about another sheet. Maybe you mean

with sheets("yourothersheetname")
if .range("c8")="Dan" etc

end with
 
Top