LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Tools/Macro/Visual Basic Editor

I'm new to this but I have finally hacked out something that does what I want
by using a basic template from another user. My code is at the bottom of the
message.

This changes the fill of the identified shapes based upon some value.

The first line of the code: "Private Sub Worksheet_Change(ByVal Target As
Range)"
was included in the template. I don't know if this is just a title, whether
it has some specific syntax or format or what.

I also cannot find a list of Me.Shapes. "Face" is a smiley face that was
included in the template and "Auto Shape 2" is a shape that I added using the
draw tool. It seems that somewhere in Excel I should be able to find a list
of these shapes and that there should be a way to rename the AutoShapes to
something more meaningful like you would with a range name.

Any help will be appreciated.

Private Sub Worksheet_Change(ByVal Target As Range)
Me.Shapes("Face").Select
With Range("FaceInd")
If .Value <= 3 Then
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 0, 0)
ElseIf .Value 3 And .Value <= 6 Then
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 254, 0)
Else
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(88, 146, 0)
End If

.Select
End With

Me.Shapes("AutoShape 2").Select
With Range("AutoShape2ID")
If .Value <= 3 Then
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 0, 0)
ElseIf .Value 3 And .Value <= 6 Then
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 254, 0)
Else
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(88, 146, 0)
End If

.Select
End With

End Sub

 
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
Visual Basic Editor Ron Rueter Excel Discussion (Misc queries) 3 October 28th 08 02:48 PM
Password in Visual basic editor Tia[_3_] Excel Worksheet Functions 0 July 11th 08 08:40 AM
Visual basic editor Answerfactory Excel Discussion (Misc queries) 3 October 9th 06 09:13 PM
Can I run Visual Basic procedure using Excel Visual Basic editor? john.jacobs71[_2_] Excel Programming 3 December 26th 05 02:22 PM
When you edit a macro in visual basic editor, why doesn't it upda. [email protected] Excel Programming 1 March 8th 05 04:19 PM


All times are GMT +1. The time now is 01:38 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"