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: 9
Default shape range help

Greetings,
I just upgraded to Excel 2003 a few weeks ago - and the IT
department left out some VBA help files! It is going to be a couple of
days before I have time to wander over there, and in the mean time I'm
discovering that few books on Excel Programming say much about the
drawing layer. So...

I have a fairly large group of shapes grouped into a shape named
"network" , which consists of nodes, edges and costs on the edges. I
want to be able to change the cost displayed on certain edges (the
costs themselves are in text boxes). I gather from google that you have
to ungroup - change - regroup. I can ungroup and change no problem - it
is the regroup that is throwing me. Based on some code snippets I saw
on this group, I would think that the following should work, but it
throws an error:

Sub changeCost(costName As String, newCost As Long)

Dim shpRng As ShapeRange, network As Shape
Dim A As Variant
Dim i As Long, n As Long
Set network = Shapes("network")
n = network.GroupItems.Count
ReDim A(0 To n - 1)
For i = 1 To n
A(i - 1) = network.GroupItems(i).Name
Next i
network.Ungroup
Shapes(costName).TextFrame.Characters.Text = newCost

Set shpRng = Shapes.Range(A)
shpRng.Group
shpRng.Name = "network"

End Sub
+++++++++++++++++++

The line which causes problems is: Set shpRng = Shapes.Range(A)

What bozo-like programming error am I making? Any help would be
appreciated. Is there some sort of way to directly transfer the
groupitems to a shaperange?

Thanks for reading this

-semiopen

 
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
Shape Range kuhrty Charts and Charting in Excel 3 April 22nd 10 05:12 PM
my curser changed from arrow shape to a cross shape???? bj New Users to Excel 1 February 5th 07 02:47 PM
Possible to select a range of cells from a Shape Object Gummy Excel Programming 1 May 11th 06 12:06 AM
Detecting if a range contains a shape Nick Hebb Excel Programming 3 October 28th 05 02:45 AM
align a picture/shape in a Range! Andoni[_18_] Excel Programming 1 August 22nd 04 06:11 PM


All times are GMT +1. The time now is 01:34 AM.

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"