PC Review


Reply
Thread Tools Rate Thread

conditional format shape in a diffrent sheet

 
 
=?Utf-8?B?TWljaGFlbCBTLg==?=
Guest
Posts: n/a
 
      16th Nov 2006
Hi there

I have a workbook with 2 sheets. in the first sheet (sheet1) i have embeded
a textbox. Also in the first sheet there is a cell which shows a result of a
formula (the result can be 1, 2 or 3).

In the second sheet (sheet2) there is a shape (rectangle 1).

Now the shape should change its color while typing in the textbox in
condition to the result of the formula mentioned above.

If the shape is in the same sheet as the textbox, there is no problem to
realize my goal. As soon as the shape is in a different sheet, the following
code does not work. Can anybody help me please?

Thanks
Michael

Private Sub TextBox1_Change()

If Sheets("sheet1").Range("A1") = "1" Then

Sheets("sheet2").Shapes("rectangle 1").Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 50 'green

End If

If Sheets("sheet1").Range("A1") = "2" Then

Sheets("sheet2").Shapes("rectangle 1").Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 10 'red

End If

If Sheets("sheet1").Range("A1") = "3" Then

Sheets("sheet2").Shapes("rectangle 1").Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 13 'yellow

End If
End Sub

 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      16th Nov 2006
try this. modify your sheet and range to suit
Private Sub TextBox1_Change()
Select Case Sheets("sheet4").Range("g1")
Case 1: mc = 50
Case 2: mc = 10
Case 3: mc = 13
Case Else
mc =10
End Select
Sheets("sheet6").Shapes("rectangle 1") _
..Fill.ForeColor.SchemeColor = mc
End Sub

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Michael S." <(E-Mail Removed)> wrote in message
news:88905D61-416B-45D5-8CDF-(E-Mail Removed)...
> Hi there
>
> I have a workbook with 2 sheets. in the first sheet (sheet1) i have
> embeded
> a textbox. Also in the first sheet there is a cell which shows a result of
> a
> formula (the result can be 1, 2 or 3).
>
> In the second sheet (sheet2) there is a shape (rectangle 1).
>
> Now the shape should change its color while typing in the textbox in
> condition to the result of the formula mentioned above.
>
> If the shape is in the same sheet as the textbox, there is no problem to
> realize my goal. As soon as the shape is in a different sheet, the
> following
> code does not work. Can anybody help me please?
>
> Thanks
> Michael
>
> Private Sub TextBox1_Change()
>
> If Sheets("sheet1").Range("A1") = "1" Then
>
> Sheets("sheet2").Shapes("rectangle 1").Select
> Selection.ShapeRange.Fill.ForeColor.SchemeColor = 50 'green
>
> End If
>
> If Sheets("sheet1").Range("A1") = "2" Then
>
> Sheets("sheet2").Shapes("rectangle 1").Select
> Selection.ShapeRange.Fill.ForeColor.SchemeColor = 10 'red
>
> End If
>
> If Sheets("sheet1").Range("A1") = "3" Then
>
> Sheets("sheet2").Shapes("rectangle 1").Select
> Selection.ShapeRange.Fill.ForeColor.SchemeColor = 13 'yellow
>
> End If
> End Sub
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy conditional format from one sheet to another using VBA KrisN Microsoft Excel Programming 0 23rd Jun 2008 08:45 PM
Conditional Format from other sheet =?Utf-8?B?U2hlaWxhIEQ=?= Microsoft Excel Misc 2 28th Feb 2007 02:29 PM
can I use conditional format on an auto shape =?Utf-8?B?SG9yc2U=?= Microsoft Excel Misc 1 5th Feb 2007 01:44 PM
Conditional Format using value from another sheet =?Utf-8?B?Sm9lIEdpZWRlcg==?= Microsoft Excel Worksheet Functions 5 23rd Mar 2005 03:07 PM
conditional format based on sheet name Todd Microsoft Excel Worksheet Functions 7 6th Apr 2004 08:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:29 AM.