LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default what is my self?

There are two types of buttons you can use on a worksheet--one is from the
Control toolbox toolbar and the other is from the Forms tooblar.

My previous post had two different suggestions--one for each type button.

Sonnich wrote:

Dave Peterson wrote:
Is this a commandbutton from the control toolbox toolbar?


It is a button on a sheet.

And is your code behind that worksheet?


Set MyFile = Workbooks.Open(file1)
Set AnotherFile = Workbooks.Open(file1)
MyFile.DoSomething;
blabla
blabla

PrintSomethingToSheetWithButton

end;


msgbox me.name
would give you the name of the sheet that holds the code.


causes "invalud used of keyword "me"


or
application.goto me.range("a1")
to return to A1 of that sheet.


======
If you're using a button from the Forms toolbar:

Dim ActSheet as worksheet
set actsheet = activesheet
'do lots of stuff
'and you can refer to that variable

application.goto actsheet.range("a1")
'or whatever


Sonnich wrote:

Hi!

Once someone helped me to do so:
Set MyFile = Workbooks.Open(file1)

- myfile becomes an object I can work with. (thanks!)

but how do I get the place, where my button is - the sheet, on which
the event is triggered?

BR
Sonnich


--

Dave Peterson


--

Dave Peterson
 
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



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