Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 17
Default Floating object?

How do i make an object float in the worksheet?
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 7,247
Default Floating object?

It depends on the object and what you really mean by "float". Details count.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)

"Anand vijay" wrote in message
...
How do i make an object float in the worksheet?



  #3   Report Post  
Posted to microsoft.public.excel.newusers
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Floating object?

"Anand vijay" wrote:
How do i make an object float in the worksheet?


This sample from my archives illustrates an example
using code by Orlando Magalhaes Filho:
http://savefile.com/files/230799
Floating Textbox Example.xls
(full details inside, nicely rendered)

The notes inside: ..
or making use of a Floating text Box.


In this sample file, the demo "text box 1" in Sheet1 -- with the
eye-catching classic Ferrari thrown in as a bonus <g -- will remain fixed in
the top left corner when we scroll down or across the sheet (test this out!)

I played with some past code by Orlando Magalhaes Filho (below)
and it seems to do the above nicely

Steps:
Draw a text box (default named:"Text Box 1") on the sheet first
[Or insert a picture, then rename it as: Text Box 1]

Then install the code by right-clicking on sheet tab View code
then copy n paste Orlando's code into the code window
[ Adjust the x, y offsets to suit - I set these arbitrarily to 10]

'---
Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
'by Orlando Magalhaes Filho in .programming
x_offset = 10
y_offset = 10
ActiveSheet.Shapes("Text Box 1").Select
With Cells(ActiveWindow.Panes(1).ScrollRow, _
ActiveWindow.Panes(1).ScrollColumn)
xpos = .Left + x_offset
ypos = .Top + y_offset
End With
With Selection
.Left = xpos
.Top = ypos
End With
Target.Select
End Sub
'---
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
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
Object Variable Not Set Error on Selection object Jean Excel Worksheet Functions 3 July 24th 06 06:45 PM
Cannor strech embedded word object BartDesc Excel Discussion (Misc queries) 2 March 10th 06 08:15 AM
Object Frank Xia Setting up and Configuration of Excel 0 March 3rd 06 12:08 AM
SET statement tutorial Daminc Excel Discussion (Misc queries) 13 January 17th 06 04:47 PM
VBA: Where to find Excel Object model? N. Foldager Excel Discussion (Misc queries) 13 February 6th 05 06:43 PM


All times are GMT +1. The time now is 05:57 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"