Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Command Buttons Location


When I am creating a new button I have a chance of making it any size
and place it wherever I want to:

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Comma ndButton.1",
Link:=False, DisplayAsIcon:=False, Left:=413.25, Top:=48.75, Width:=72,
Height:=24).Select


I can also move it with respect to its location:

With Worksheets("Sheet1")
Set Button = .OLEObjects("CommandButton1")
ActiveSheet.Shapes("CommandButton1").Select
Selection.ShapeRange.IncrementLeft 100
Selection.ShapeRange.IncrementTop -200
End With

But how do I move it with respect to the original coordinates?

Thank you,


--
pontiy
------------------------------------------------------------------------
pontiy's Profile: http://www.excelforum.com/member.php...o&userid=32885
View this thread: http://www.excelforum.com/showthread...hreadid=527267

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Command Buttons Location

With Worksheets("Sheet1")
Dim b as OleObject
Set b = .OLEObjects("CommandButton1")
b.Top = b.top + 10
b.Left = b.Left + 1
End With

also width and Height properties.


--
Regards,
Tom Ogilvy



"pontiy" wrote:


When I am creating a new button I have a chance of making it any size
and place it wherever I want to:

ActiveSheet.OLEObjects.Add(ClassType:="Forms.Comma ndButton.1",
Link:=False, DisplayAsIcon:=False, Left:=413.25, Top:=48.75, Width:=72,
Height:=24).Select


I can also move it with respect to its location:

With Worksheets("Sheet1")
Set Button = .OLEObjects("CommandButton1")
ActiveSheet.Shapes("CommandButton1").Select
Selection.ShapeRange.IncrementLeft 100
Selection.ShapeRange.IncrementTop -200
End With

But how do I move it with respect to the original coordinates?

Thank you,


--
pontiy
------------------------------------------------------------------------
pontiy's Profile: http://www.excelforum.com/member.php...o&userid=32885
View this thread: http://www.excelforum.com/showthread...hreadid=527267


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
Command buttons Anna B Excel Programming 6 February 24th 06 06:30 PM
Help with command buttons Danno Excel Worksheet Functions 1 October 7th 05 10:32 PM
command buttons Natalie Excel Worksheet Functions 1 March 7th 05 01:45 PM
Command buttons Russell Stevenson Excel Programming 3 November 12th 03 02:57 AM
Control Buttons vs. Command Buttons Robert Gibson Excel Programming 1 October 13th 03 04:33 PM


All times are GMT +1. The time now is 12:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"