Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find ColorIndex

Hi all

I am trying to use the value in Cell D2 on sheet sht, then find th
cell where that value is on sheet sTL, take the interior colorindex o
that cell and apply it to some formatting on a sheet that I am adding.

Dim Cind as Long
Dim LookRng as Range, FndRng as Range
Dim Stl as Worksheet 'sheet 1
Dim sht as worksheet 'sheet 2

Set LookRng = sTL.Range("b4", sTL.Range("b"
sTL.Rows.Count).End(xlUp))
Set FndRng = LookRng.Find(sht.Range("D2").Value)
Cind = FndRng.Offset(0, 1).Interior.ColorIndex
...
Selection.Interior.ColorIndex = cind

I may be going about this all the wrong way, but I am getting an erro
(91) on the cind = line.

Any help would be greatly appreciated. Thanks.
R

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find ColorIndex

Try this!

Sub AAA()
Dim Cell_Value As Variant
Dim Cell_ColoIndex As Byte

Cell_Value = Sheets("Sht").Range("D2").Value
On Error Resume Next
With Sheets("sTL")
.Visible = True
.Activate
.Range("A1").Select
Cells.Find( _
What:=Cell_Value, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False).Activate
End With
Cell_ColoIndex = ActiveCell.Interior.ColorIndex
'then apply this color index to you new sheet
End Su

--
Message posted from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find ColorIndex

Andoni

I am getting an error 91 on the Cells.Find Statement?

Thanks.
R

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find ColorIndex

Andoni

I am getting an error 91 on the Cells.Find Statement?

Thanks.
R

--
Message posted from http://www.ExcelForum.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find ColorIndex

Hi
I am getting an error 91 on the Cells.Find equation, can anybody els
possibly help me out? Thanks.
R

--
Message posted from http://www.ExcelForum.com

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
ColorIndex skat Excel Worksheet Functions 5 June 5th 06 02:42 AM
colorindex Nell Fahey Excel Discussion (Misc queries) 3 April 28th 05 07:06 PM
WHere can I find a list of ColorIndex colors? Christiane[_12_] Excel Programming 3 April 28th 04 04:12 PM
ColorIndex Trevor Davidson Excel Programming 5 April 26th 04 10:39 PM
ColorIndex K Bro Excel Programming 2 February 7th 04 04:42 PM


All times are GMT +1. The time now is 08:45 PM.

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"