Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have the following code: Code: -------------------- With Worksheets("Sheet1").Shapes("Text1").Line .ForeColor.SchemeColor = 26 .Weight = 2 End With With Worksheets("Sheet1").Shapes("Text2").Line .ForeColor.SchemeColor = 26 .Weight = 2 End With -------------------- As you can see, I am doing the same thing with both Shapes("Text1") and Shapes("Text2"). How do I combine the 2 With Statements above without physically grouping the items on the drawing toolbar? Thanks in advance! -- grime ------------------------------------------------------------------------ grime's Profile: http://www.excelforum.com/member.php...o&userid=19227 View this thread: http://www.excelforum.com/showthread...hreadid=507907 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() dim i as integer for i=1 to 2 With Worksheets("Sheet1").Shapes("Text" & cstr(i)).Line ..ForeColor.SchemeColor = 26 ..Weight = 2 End With next i or some such depending on the names you have used regards -- tony h ------------------------------------------------------------------------ tony h's Profile: http://www.excelforum.com/member.php...o&userid=21074 View this thread: http://www.excelforum.com/showthread...hreadid=507907 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() With Worksheets("Sheet1").Shapes.Range(Array("Text1", "Text2")).Line .ForeColor.SchemeColor = 26 .Weight = 2 End With Jim Cone San Francisco, USA http://www.realezsites.com/bus/primitivesoftware "grime"wrote in message I have the following code: Code: -------------------- With Worksheets("Sheet1").Shapes("Text1").Line .ForeColor.SchemeColor = 26 .Weight = 2 End With With Worksheets("Sheet1").Shapes("Text2").Line .ForeColor.SchemeColor = 26 .Weight = 2 End With -------------------- As you can see, I am doing the same thing with both Shapes("Text1") and Shapes("Text2"). How do I combine the 2 With Statements above without physically grouping the items on the drawing toolbar? Thanks in advance! -- grime |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This may be what you were asking about
With Worksheets("Sheet1") With .Shapes("Text1").Line .ForeColor.SchemeColor = 26 .Weight = 2 End With With .Shapes("Text2").Line .ForeColor.SchemeColor = 26 .Weight = 2 End With End With Although, with the exact example given either of the other solutions are better, although I would be inclined to modify grime's code to read. dim i as integer With Worksheets("Sheet1"). for i=1 to 2 With Shapes("Text" & cstr(i)).Line .ForeColor.SchemeColor = 26 .Weight = 2 End With next i End With Of course, unless you were executing this specific code often, such as in a long loop, I wouldn't worry about the few extra dots. -- My handle should tell you enough about me. I am not an MVP, expert, guru, etc. but I do like to help. "grime" wrote in message ... I have the following code: Code: -------------------- With Worksheets("Sheet1").Shapes("Text1").Line .ForeColor.SchemeColor = 26 .Weight = 2 End With With Worksheets("Sheet1").Shapes("Text2").Line .ForeColor.SchemeColor = 26 .Weight = 2 End With -------------------- As you can see, I am doing the same thing with both Shapes("Text1") and Shapes("Text2"). How do I combine the 2 With Statements above without physically grouping the items on the drawing toolbar? Thanks in advance! -- grime ------------------------------------------------------------------------ grime's Profile: http://www.excelforum.com/member.php...o&userid=19227 View this thread: http://www.excelforum.com/showthread...hreadid=507907 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help displaying "Maximum" or "Minimum" if cell is max or min in a group? | Excel Discussion (Misc queries) | |||
How do i enable "Group" & "Ungroup" in a protected sheet | Excel Discussion (Misc queries) | |||
=IF(VLOOKUP(C11,Group,2,FALSE)=D11,"True","Not Valid") and =IF(D1 | Excel Worksheet Functions | |||
How do i enable "Group" & "Ungroup" in a protected sheet | Excel Discussion (Misc queries) | |||
Pivot table "Group and Show Details" vs. "SubTotals" | Excel Programming |