Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi Tranpkp, The answer you gave 2

Status
Not open for further replies.

nimo

Programmer
Apr 26, 2002
20
DE
Hi Tranpkp,

The answer you gave on Seeing the text on the Rectangles was really helpful. But one thing I still cannot decide. It is possible to have 100s of rectangles like this. So clicking a rectangle, then assiging bring to Front is not possible......the whole thing has to be Automated........suppose u have a Excell Sheet with 100 Rectangles and u want ONLY click one rectangle to know the full text that it has.....how do I do this? When I click, the full text should be visible in that rectangle, but only 1 click is allowed, no other assigning Macro or Using bring to front.........

Is it possible?

Nimo
 
Hi

CAn i use
.onAction here? how?

nimo
 
Nimo, didn't want to blow you off, however sorry very busy now. Been investing too much darn time on this site anyhow! ;) Honestly I have never had any inexperience what so ever in this prior to your issue, so resolving that was huge for me:) Anyways I don't really understand what you are asking now. I know it wasn't the prettiest solution ever, but I felt it was creative and actually performed what you originally asked.
In regards to the 100 rectangles (what the heck is this file?! :) ) Seems to me maybe XL isn't the way to go? Why not use Visio or somethiing?! Anwyasy I STILL believe my solution is still good. The ZORDER property is referenceing the layers of objects/shapes. The z dimension is the one orthogonal to the screeen, coming at you, so the #>0 is the layer on top, 0 or 1 on the bottom, if you click BRING TO FRONT, I believe this brings all the way to the top. Bring forward sequentiall incremtns up. So my code says after the user made the desired rectangle on top, serach all the rectangles for the top and display its text.

I really hope this helps, but if you have any further ?s I will try to help when I can.

Tranpkp
************************************
- Let me know if this helped/worked!
Please remember to give helpful posts the stars they deserve!
This facilitates navigating through the threads / posts!
 
You can try this. Just set the Constants to the size you need, and assign all the rectangles you want to read to this macro.

Code:
Sub ToggleRectangleSize()
   Dim CurrRect            As Shape
   Const SmallHeight       As Long = 10
   Const SmallWidth        As Long = 10
   Const LargeHeight       As Long = 300
   Const LargeWidth        As Long = 300

   Set CurrRect = ActiveSheet.Shapes(Application.Caller)
   CurrRect.ZOrder (BringToFront)

   If Int(CurrRect.Height) = LargeHeight Then
      CurrRect.Height = SmallHeight
      CurrRect.Width = SmallWidth
   Else
      CurrRect.Height = LargeHeight
      CurrRect.Width = LargeWidth
   End If
End Sub

 
Wouldn't that take forever assigning 100+ rectangles to a macro? Tranpkp
************************************
- Let me know if this helped/worked!
Please remember to give helpful posts the stars they deserve!
This facilitates navigating through the threads / posts!
 
Hi Tranpkp,

No, not really. Here is a way to bulk assign the macros.

A) Select multiple rectangles by either:[ol][li] Holding down the Shift+Ctrl keys, and selecting all the boxes you want to assign.
[/li][li] Using the Object Selector from the Drawing toolbar, hold down the Shift key, while selecting all the boxes you want to assign.[/li]
[li] Using the Object Selector from the Drawing toolbar, click a spot in the upper left corner, then drag your mouse down and to the right. All encompassed objects will be selected.
[/li][/ol]B) When done selecting, make sure the mouse is over one of the selected rectangles, then right click and assign the macro as usual.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top