Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
Thanks! I haven't tried this - but what I was wishing for was adding some sort of variable - which you did in the second example which applies to what I'm doing. Thanks again! It may need some tweaking, but I think it puts me on the right path. Best Regards, Anita Tom Ogilvy wrote: for a commandbutton Sub MoveButton() Dim OleObj As OLEObject ActiveSheet.Shapes("CommandButton1").Select Selection.Copy Range("G15").Select ActiveSheet.Paste Set OleObj = Selection With Range("B9") OleObj.Top = .Top OleObj.Left = .Left End With End Sub for a forms toolbar button Sub MoveButton() Dim btn As Button ActiveSheet.Shapes("Button 1").Select Selection.Copy Range("G15").Select ActiveSheet.Paste Debug.Print TypeName(Selection) Set btn = Selection With Range("B9") btn.Top = .Top btn.Left = .Left End With End Sub Of course, selecting B9 before the past would obviate the need to move them. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Looping through files in a folder | Excel Programming | |||
Looping thru files extracting data | Excel Programming | |||
Looping though *.xls files except for the main consolidation file | Excel Programming | |||
Looping thru files | Excel Programming | |||
looping to create multiple files | Excel Programming |