MS Excel 2007 - SHAPES - Select whole group with grouped textboxes, instead of textbox in group.
-
2012年3月21日 9:20
Hello,
I have added different textboxes and shapes into a group in MS Excel 2007.
When I want to select the whole group of shapes I have to click outside the "textbox shape" area otherwise it wil select only the textbox shape in the group.
My problem is that my whole group is the "textbox shape"area. And i want to select the whole group when clicking on it.
Does anybody know a solution for this problem? In settings or VBA code?
Thanks in advance,
Vincent
すべての返信
-
2012年3月21日 9:28
Does it make it easier to select the required item(s) if you use the Selection Pane.
Home tab > Editing > Find & Select > Selection Pane.
Cheers,
Andy
www.andypope.info -
2012年3月21日 10:48
Nope, it does not.
It makes no difference.
-
2012年3月21日 11:27回答者:
Not Sure what you need but following will select all the shape in Activesheet.
ActiveSheet.Shapes.SelectAll
- 回答の候補に設定 Yoyo JiangMicrosoft Contingent Staff, Moderator 2012年3月23日 4:18
- 回答の候補の設定解除 Vincent2012 2012年3月28日 6:53
-
2012年3月23日 0:32モデレータ
Three ways I can think of
1) Selecting on the main border
2) Typing the Group Name in the "Name Box"
3) VBA
Sub Sample() '~~> Change this to the relevant Group Sheets("Sheet1").Shapes("Group 4").Select End SubHTH
Sid (A good exercise for the Heart is to bend down and help another up) Please do not email me your questions. I do not answer questions by email unless I get paid for it :) If you want, create a thread in VB.Net/Excel forum and email me the link and I will help you if I can.
- 編集済み Siddharth RoutMVP, Moderator 2012年3月23日 0:32
- 編集済み Siddharth RoutMVP, Moderator 2012年3月23日 0:33
- 編集済み Siddharth RoutMVP, Moderator 2012年3月23日 0:33 Post Formatting went for a toss as usual...
- 回答の候補に設定 Yoyo JiangMicrosoft Contingent Staff, Moderator 2012年3月23日 4:18
- 回答の候補の設定解除 Vincent2012 2012年3月28日 6:53
- 回答としてマーク Yoyo JiangMicrosoft Contingent Staff, Moderator 2012年4月5日 3:59
- 回答としてマークされていない Yoyo JiangMicrosoft Contingent Staff, Moderator 2012年4月5日 3:59
- 回答の候補に設定 Yoyo JiangMicrosoft Contingent Staff, Moderator 2012年4月5日 3:59
-
2012年3月23日 8:49
You are right, on all three ways you select the whole group.
But still not an answer to my question: " I want to select the whole group when clicking on it".
I found out that pressing the control button before clicking on the group does select the whole group, so that's a work around, but I think it should be possible to programm it in a way that it selects the group automatically when clicking on it.
- 編集済み Vincent2012 2012年3月23日 8:49
- 編集済み Vincent2012 2012年3月23日 8:50
-
2012年4月11日 15:29
I have a slightly different problem but I believe the same answer could help both me and Vincent.
Is there a way of determining the name of the group that a clicked shape belongs to?
Vincent could then use this to help him utilise Siddharth Rout's sample code and I could use it for my purpose, which is to delete the group when a little red rectangle in the the top right corner of the group is clicked.
Br, Nick.
Edit: I should add that in my case I won't know the name of the group because multiple copies of the sheet containing this group may be created within the workbook. Also this is not the only group of shapes to exist on the sheet.- 編集済み onimoD XLT 2012年4月11日 16:09 Clarity
-
2012年4月12日 9:43
Hi Vincent,
I believe I have your answer. Don't use textboxes, i.e. use rectangles instead and edit their text property. You should then find that one click selects the whole group.
Br, Nick.
- 回答の候補に設定 onimoD XLT 2012年4月12日 9:44
-
2012年4月12日 9:58
Okay I've solved my problem but for completeness and so that it might help someone else I'll put my solution here...
Basically I have three groups - little helper texts like the one above - which get propogated each time the user creates a certain type of sheet (which is a copy from a hidden template sheet). The group names get incremented each time but the individual shape names remain constant i.e. Group names appear to have a scope of 'Workbook' while shape names have a scope of 'Sheet'.
The red delete buttons have been named DelButton1, DelButton2 and DelButton3 and each is assigned to the macros DelGrp1, 2 and 3 respectively...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Public Sub DelGrp1()
DeleteGroup (1)
End SubPublic Sub DelGrp2()
DeleteGroup (2)
End SubPublic Sub DelGrp3()
DeleteGroup (3)
End SubPrivate Sub DeleteGroup(ByVal aNum As Long)
Dim shp As Shape
Dim grp As ShapeFor Each grp In ActiveSheet.Shapes
If grp.Name Like "Group*" Then
For Each shp In grp.GroupItems
If shp.Name = "DelButton" & aNum Then
grp.Delete
Exit Sub
End If
Next
End If
Next
End Sub~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I hope someone finds this useful.
Br, Nick.

