Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / November 2006

Tip: Looking for answers? Try searching our database.

VBA Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SiliconAlleyDude - 01 Nov 2006 15:42 GMT
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
Don Guillett - 01 Nov 2006 16:41 GMT
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

Signature

Don Guillett
SalesAid Software
dguillett1@austin.rr.com

>I am using a VBA Code snippet which I am using to get around the
>conditional
[quoted text clipped - 35 lines]
>
> Vince
SiliconAlleyDude - 02 Nov 2006 14:56 GMT
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

> Are you trying to change ws2 from a worksheet change event in ws1? If so
>
[quoted text clipped - 41 lines]
> >
> > Vince
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.