Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default VBA Question

I am using a VBA Code snippet which I am using to get around the conditional
format restriction.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer

<== Start Code snippet ==
' Define conditional formats
If Not Intersect(Target, Range("E4:IV1003")) Is Nothing Then
Select Case Target
Case ""
icolor = 0
' Define Code e.g. "Code" or "Description"
Case "A"
' Define color as stated in the color index.
icolor = "3"
Case "Test"
icolor = 4
Case Else
'Whatever
End Select

Target.Interior.ColorIndex = icolor
End If

End Sub
<== END Code snippet ==

Currently I have this in Worksheet1. In worksheet2 I have a table where I
want to define "A" and "1".

Can you please let me know how I can reference Worksheet2!C2 where the value
for "A" in and Worksheet2!D2 where the value for "1" would be defined?

Thanks in advance for your support.

Vince
  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 2
Default VBA Question

In the Range E4:IV1003 in ws1 I will have to insert different codes.
The color codes and the codes will be specified in ws2.

e.g. :
A1: Description | B1: Code | C1: Color Index
A2: Concept Test | B2: CT | C2: 3

Case needs to be read from WS2-B2
icolor needs to be read from WS2-C2

Thanks in advance

"Don Guillett" wrote:


Are you trying to change ws2 from a worksheet change event in ws1? If so

case "A" then sheets("sheet2").range("a1").interior.colorindex=3

If not, pls explain

--
Don Guillett
SalesAid Software

"SiliconAlleyDude" wrote in
message ...
I am using a VBA Code snippet which I am using to get around the
conditional
format restriction.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim icolor As Integer

<== Start Code snippet ==
' Define conditional formats
If Not Intersect(Target, Range("E4:IV1003")) Is Nothing Then
Select Case Target
Case ""
icolor = 0
' Define Code e.g. "Code" or "Description"
Case "A"
' Define color as stated in the color index.
icolor = "3"
Case "Test"
icolor = 4
Case Else
'Whatever
End Select

Target.Interior.ColorIndex = icolor
End If

End Sub
<== END Code snippet ==

Currently I have this in Worksheet1. In worksheet2 I have a table where I
want to define "A" and "1".

Can you please let me know how I can reference Worksheet2!C2 where the
value
for "A" in and Worksheet2!D2 where the value for "1" would be defined?

Thanks in advance for your support.

Vince




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
Possibly a loaded question, but I think mileslit Excel Discussion (Misc queries) 1 September 10th 05 01:18 AM
How do I find and replace a question mark in Excel? Ranpalandil Excel Discussion (Misc queries) 1 September 7th 05 10:20 PM
Newbie With A Question Michael Excel Worksheet Functions 0 July 28th 05 11:50 PM
Anybody Help with previous question Anthony Excel Discussion (Misc queries) 1 July 26th 05 01:26 PM
Hints And Tips For New Posters In The Excel Newsgroups Gary Brown Excel Worksheet Functions 0 April 15th 05 05:47 PM


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