Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Floating Drawing Object

Hi All.........
If someone would be so kind.....I'm trying to find out how to make a Drawing
Object, (specifically "Rectangle 1") float on the screen like some of the
annoying pop-ups do, so it will always be on-screen as the user scrolls up
and down the sheet. I know about the Freeze line, but don't want that in
this case.

TIA
Vaya con Dios,
Chuck, CABGx3


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Floating Drawing Object

AFAIK you can't do that with a shape, but you can with Modeless Userform.
Then put whatever you want on the userform.

NickHK

"CLR" wrote in message
...
Hi All.........
If someone would be so kind.....I'm trying to find out how to make a

Drawing
Object, (specifically "Rectangle 1") float on the screen like some of the
annoying pop-ups do, so it will always be on-screen as the user scrolls up
and down the sheet. I know about the Freeze line, but don't want that in
this case.

TIA
Vaya con Dios,
Chuck, CABGx3




  #3   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Floating Drawing Object

Thanks NickHK..........
I'm not familiar with those yet......I'll have to do some research.
Thanks for the tip.

Vaya con Dios,
Chuck, CABGx3




"NickHK" wrote:

AFAIK you can't do that with a shape, but you can with Modeless Userform.
Then put whatever you want on the userform.

NickHK

"CLR" wrote in message
...
Hi All.........
If someone would be so kind.....I'm trying to find out how to make a

Drawing
Object, (specifically "Rectangle 1") float on the screen like some of the
annoying pop-ups do, so it will always be on-screen as the user scrolls up
and down the sheet. I know about the Freeze line, but don't want that in
this case.

TIA
Vaya con Dios,
Chuck, CABGx3





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Floating Drawing Object

CLR wrote:
Hi All.........
If someone would be so kind.....I'm trying to find out how to make a Drawing
Object, (specifically "Rectangle 1") float on the screen like some of the
annoying pop-ups do, so it will always be on-screen as the user scrolls up
and down the sheet. I know about the Freeze line, but don't want that in
this case.

TIA
Vaya con Dios,
Chuck, CABGx3


Hi Chuck,

This it pretty rough and probably just for a laugh...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Me.Shapes("Rectangle 1")
..Top = ActiveWindow.VisibleRange.Top + 100
..Left = ActiveWindow.VisibleRange.Left + 100
End With
End Sub


When the user scrolls the rectangle out of view it does move out of
view. However,
If the visible range is clicked then the rectangle reappears 100 points
from the top and left side.

Ken Johnson

  #5   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Floating Drawing Object

That is OUTSTANDING Ken..........thanks a HEAP. I had a small problem of it
coming up behind other Drawing Objects but was able to figure out how to
bring it to the front and now life is good. It works perfectly, as you
described, and I really appreciate your help.

Vaya con Dios,
Chuck, CABGx3



"Ken Johnson" wrote:

CLR wrote:
Hi All.........
If someone would be so kind.....I'm trying to find out how to make a Drawing
Object, (specifically "Rectangle 1") float on the screen like some of the
annoying pop-ups do, so it will always be on-screen as the user scrolls up
and down the sheet. I know about the Freeze line, but don't want that in
this case.

TIA
Vaya con Dios,
Chuck, CABGx3


Hi Chuck,

This it pretty rough and probably just for a laugh...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Me.Shapes("Rectangle 1")
..Top = ActiveWindow.VisibleRange.Top + 100
..Left = ActiveWindow.VisibleRange.Left + 100
End With
End Sub


When the user scrolls the rectangle out of view it does move out of
view. However,
If the visible range is clicked then the rectangle reappears 100 points
from the top and left side.

Ken Johnson




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Floating Drawing Object


CLR wrote:
That is OUTSTANDING Ken..........thanks a HEAP. I had a small problem of it
coming up behind other Drawing Objects but was able to figure out how to
bring it to the front and now life is good. It works perfectly, as you
described, and I really appreciate your help.

Vaya con Dios,
Chuck, CABGx3


Hi Chuck,

However, it is annoying when you want to select a cell that is
underneath Rectange 1, so I have made a version that prevents that
annoyance...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Box As Shape
Set Box = Me.Shapes("Rectangle 1")
If Selection.Left + Selection.Width _
+ Box.Width Rows(1).Width Then
Box.Left = Selection.Left - Box.Width
Else: Box.Left = Selection.Left + Selection.Width
End If
If Selection.Top + Selection.Height _
+ Box.Height Columns(1).Height Then
Box.Top = Selection.Top - Box.Height
Else: Box.Top = Selection.Top + Selection.Height
End If
Box.ZOrder msoBringToFront
End Sub

Ken Johnson

  #7   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 1,998
Default Floating Drawing Object

YES SIR!!!!!.........that is really really cool........thanks many bunches
Ken, you are a Prince of Programmers.

Vaya con Dios,
Chuck, CABGx3



"Ken Johnson" wrote:


CLR wrote:
That is OUTSTANDING Ken..........thanks a HEAP. I had a small problem of it
coming up behind other Drawing Objects but was able to figure out how to
bring it to the front and now life is good. It works perfectly, as you
described, and I really appreciate your help.

Vaya con Dios,
Chuck, CABGx3


Hi Chuck,

However, it is annoying when you want to select a cell that is
underneath Rectange 1, so I have made a version that prevents that
annoyance...

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim Box As Shape
Set Box = Me.Shapes("Rectangle 1")
If Selection.Left + Selection.Width _
+ Box.Width Rows(1).Width Then
Box.Left = Selection.Left - Box.Width
Else: Box.Left = Selection.Left + Selection.Width
End If
If Selection.Top + Selection.Height _
+ Box.Height Columns(1).Height Then
Box.Top = Selection.Top - Box.Height
Else: Box.Top = Selection.Top + Selection.Height
End If
Box.ZOrder msoBringToFront
End Sub

Ken Johnson


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Floating Drawing Object


Hi Chuck,

Glad you like it.
Thanks for those kind words, I'll pass them on to my superiors;-)

Ken Johnson

  #9   Report Post  
Posted to microsoft.public.excel.programming
CLR CLR is offline
external usenet poster
 
Posts: 594
Default Floating Drawing Object

Indeed I do like what you have done for me...........and INDEED you are
worthy of the kind words, and more. Lots of folks can flip out a quick
answer, but your insight to my problem was keen. You responded in a timely
manner, and then you even took it a step further by actually trying out your
original code beyond your initial testing. Then, when discovering a
difficulty with it that would could turn out to be a user problem, you went
on to fix it and come up with a really neat working final piece and returned
to offer it in place of your original. I do sincerely appreciate your
efforts, your fine talents, and your character, all brought into play in
this instance. Many many thanks, and please stick around these newsgroups
as I will no doubt need more help in the future.

Vaya con Dios,
Chuck, CABGx3





"Ken Johnson" wrote in message
ups.com...

Hi Chuck,

Glad you like it.
Thanks for those kind words, I'll pass them on to my superiors;-)

Ken Johnson



  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Floating Drawing Object

Hi Chuck,

Thank you for those very kind words!

These newsgroups are easily the most effective way of improving one's
IT skills. My learning curve will go into a steep nose-dive should I
ever stop making use of them.

I look forward to reading you frequent replies to users' questions
and I admire your ability to find the simple solutions while I'm
struggling to get a clear view of the forest because the trees keep
getting in the way:-)

Ken Johnson

Reply
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
Floating Object Gator Excel Discussion (Misc queries) 0 March 20th 08 02:59 PM
Floating object? Anand vijay New Users to Excel 2 January 20th 07 02:38 AM
Drawing Object in a Userform Zone Excel Programming 4 May 9th 06 08:27 PM
Drawing Object Shawn Excel Programming 2 March 2nd 05 03:04 PM
Drawing object references JASon Excel Programming 2 August 28th 03 10:49 PM


All times are GMT +1. The time now is 02:37 PM.

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"