A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Shape Range



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old April 21st, 2010, 08:23 PM posted to microsoft.public.excel.charting
kuhrty
external usenet poster
 
Posts: 6
Default Shape Range

Below is a subroutine that passes in 2 variables. I am concerned with
the word "Selection" used for ShapeRange and would prefer to eliminate
it. All my attemptes have resulted in errors. I want qualify the
code to prevent error.

Is selection a keyword for ShapeRange or is there a way to qualify it?

Thanks in advance.

Public Sub CountryColor(ByVal strCountry As String, _
ByVal dColor As Double)

Dim shtMap As Worksheet, rgData As Range, strShapeNum As String
Dim i As Integer, dColor1 As Double

Set shtMap =
ThisWorkbook.Application.ThisWorkbook.Worksheets(" Map")
Set rgData =
ThisWorkbook.Application.ThisWorkbook.Worksheets(" Data").Range("RegionCountryData")

On Error Resume Next
shtMap.Select

For i = 1 To rgData.Rows.Count

strShapeNum = rgData.Cells(i, 3).Value

shtMap.Shapes(strShapeNum).Select

'This is my issue"
With Selection.ShapeRange
.Fill.ForeColor.RGB = dColor
.Fill.Visible = msoTrue
.Fill.Solid
End With

Next i

End Sub
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:54 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.