ColorIndex ...

  • Thread starter Thread starter jlarkin
  • Start date Start date
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top