Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]()
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 | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Specify shape dimensions | Excel Discussion (Misc queries) | |||
shape color | Excel Discussion (Misc queries) | |||
Shape coordinates | Excel Discussion (Misc queries) | |||
my curser changed from arrow shape to a cross shape???? | New Users to Excel | |||
Inserting into a shape | Excel Discussion (Misc queries) |