LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
a a is offline
external usenet poster
 
Posts: 51
Default Adding buttons while looping through files Question

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
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
Looping through files in a folder prepotency[_12_] Excel Programming 1 July 13th 05 04:23 PM
Looping thru files extracting data gtslabs[_2_] Excel Programming 3 June 3rd 05 04:22 PM
Looping though *.xls files except for the main consolidation file Thomas[_14_] Excel Programming 5 April 28th 04 04:17 PM
Looping thru files Tom Excel Programming 4 January 9th 04 05:05 PM
looping to create multiple files jrh Excel Programming 1 July 23rd 03 07:09 PM


All times are GMT +1. The time now is 05:03 AM.

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"