Buttons in another window

Hi All,

I I have more than one window of a workbook, buttons work only on window No. 
1.

Can it be achieved somehow that buttons work on other wondows, too?

-- 
Regards!
Stefi

0
Utf
12/7/2009 10:25:01 AM
excel.programming 6508 articles. 2 followers. Follow

10 Replies
895 Views

Similar Articles

[PageSpeed] 32

you need to have a macro for each button but the macros can call a
common subroutine located in a module

place in a vba sheet 

Private Sub CommandButton1_Click()
Call Commonbutton(ActiveSheet)
End Sub


Place in a moudle

Sub Commonbutton(Sht as Variant)



end Sub


-- 
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=160217

[url="http://www.thecodecage.com"]Microsoft Office Help[/url]

0
joel
12/7/2009 1:15:22 PM
Many thanks Joel, I'm going to try it.

-- 
Regards!
Stefi



„joel” ezt írta:

> 
> you need to have a macro for each button but the macros can call a
> common subroutine located in a module
> 
> place in a vba sheet 
> 
> Private Sub CommandButton1_Click()
> Call Commonbutton(ActiveSheet)
> End Sub
> 
> 
> Place in a moudle
> 
> Sub Commonbutton(Sht as Variant)
> 
> 
> 
> end Sub
> 
> 
> -- 
> joel
> ------------------------------------------------------------------------
> joel's Profile: 229
> View this thread: http://www.thecodecage.com/forumz/showthread.php?t=160217
> 
> [url="http://www.thecodecage.com"]Microsoft Office Help[/url]
> 
> .
> 
0
Utf
12/8/2009 8:17:01 AM
Unfortunately it didn't work. If a sheet is in a window other than window 1, 
buttons don't work at all, no macro is triggered. Pushing action is not 
animated like in cases when the button works.
-- 
Regards!
Stefi



„Stefi” ezt írta:

> Many thanks Joel, I'm going to try it.
> 
> -- 
> Regards!
> Stefi
> 
> 
> 
> „joel” ezt írta:
> 
> > 
> > you need to have a macro for each button but the macros can call a
> > common subroutine located in a module
> > 
> > place in a vba sheet 
> > 
> > Private Sub CommandButton1_Click()
> > Call Commonbutton(ActiveSheet)
> > End Sub
> > 
> > 
> > Place in a moudle
> > 
> > Sub Commonbutton(Sht as Variant)
> > 
> > 
> > 
> > end Sub
> > 
> > 
> > -- 
> > joel
> > ------------------------------------------------------------------------
> > joel's Profile: 229
> > View this thread: http://www.thecodecage.com/forumz/showthread.php?t=160217
> > 
> > [url="http://www.thecodecage.com"]Microsoft Office Help[/url]
> > 
> > .
> > 
0
Utf
12/8/2009 1:13:01 PM
Do you mean sheet 1?  Select each button and right click.  then select
view code.  Excel will automatically create the macro in the proper
location.  The button number is probably different.

I usually change the Name in the button property to something revelent
like RunAddition().  Then change the macro name of the click function to
match the name property like Private Sub RunAddition_Click().


-- 
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/showthread.php?t=160217

[url="http://www.thecodecage.com"]Microsoft Office Help[/url]

0
joel
12/8/2009 1:24:18 PM
I think it's an old bug that controls from the control toolbox toolbar won't
work when there are two windows into the same worksheet--the commandbutton in
the top window works, but the commandbutton in the bottom window doesn't (for
example).

Maybe you could replace the commandbuttons from the control toolbox toolbar with
buttons from the Forms toolbar.

(Or remove the window????)

Stefi wrote:
> 
> Hi All,
> 
> I I have more than one window of a workbook, buttons work only on window No.
> 1.
> 
> Can it be achieved somehow that buttons work on other wondows, too?
> 
> --
> Regards!
> Stefi

-- 

Dave Peterson
0
Dave
12/8/2009 1:59:43 PM
Thanks, Dave, two windows is an essential part of my present project, I'm 
going to try Forms toolbar.

I use Excel2003, do you have any information on fixing this bug in Excel2007?

-- 
Regards!
Stefi



„Dave Peterson” ezt írta:

> I think it's an old bug that controls from the control toolbox toolbar won't
> work when there are two windows into the same worksheet--the commandbutton in
> the top window works, but the commandbutton in the bottom window doesn't (for
> example).
> 
> Maybe you could replace the commandbuttons from the control toolbox toolbar with
> buttons from the Forms toolbar.
> 
> (Or remove the window????)
> 
> Stefi wrote:
> > 
> > Hi All,
> > 
> > I I have more than one window of a workbook, buttons work only on window No.
> > 1.
> > 
> > Can it be achieved somehow that buttons work on other wondows, too?
> > 
> > --
> > Regards!
> > Stefi
> 
> -- 
> 
> Dave Peterson
> .
> 
0
Utf
12/14/2009 9:48:02 AM
Thanks, Joel, I'm going to give it a try!
-- 
Regards!
Stefi



„joel” ezt írta:

> 
> Do you mean sheet 1?  Select each button and right click.  then select
> view code.  Excel will automatically create the macro in the proper
> location.  The button number is probably different.
> 
> I usually change the Name in the button property to something revelent
> like RunAddition().  Then change the macro name of the click function to
> match the name property like Private Sub RunAddition_Click().
> 
> 
> -- 
> joel
> ------------------------------------------------------------------------
> joel's Profile: 229
> View this thread: http://www.thecodecage.com/forumz/showthread.php?t=160217
> 
> [url="http://www.thecodecage.com"]Microsoft Office Help[/url]
> 
> .
> 
0
Utf
12/14/2009 9:50:01 AM
On dec. 14, 10:50, Stefi <St...@discussions.microsoft.com> wrote:
> Thanks, Joel, I'm going to give it a try!
> --
> Regards!
> Stefi
>
> =84joel=94 ezt =EDrta:
>
>
>
>
>
> > Do you mean sheet 1? =A0Select each button and right click. =A0then sel=
ect
> > view code. =A0Excel will automatically create the macro in the proper
> > location. =A0The button number is probably different.
>
> > I usually change the Name in the button property to something revelent
> > like RunAddition(). =A0Then change the macro name of the click function=
 to
> > match the name property like Private Sub RunAddition_Click().
>
> > --
> > joel
> > -----------------------------------------------------------------------=
-
> > joel's Profile: 229
> > View this thread:http://www.thecodecage.com/forumz/showthread.php?t=3D1=
60217
>
> > [url=3D"http://www.thecodecage.com"]Microsoft Office Help[/url]
>
> > .- Id=E9zett sz=F6veg elrejt=E9se -
>
> - Id=E9zett sz=F6veg megjelen=EDt=E9se -

I tried it, Joel, but it didn't help. It's interesting: If I have the
two windows already at design time then The new button works in the
second window until second window is not closed and opened again.
After re-opening a second window the button stops working in the
second window, it works only in the 1st window.
I couldn't find any other workaround than Dave's suggestion to use
Forms buttons (it works, thanks to Dave for it!).
Regards,
Stefi
0
Stefi
12/14/2009 10:46:22 AM
I don't use xl2007 to know if the bug has been fixed in xl2007.

If you're looking for an answer, then maybe someone running xl2007 will chime
in.

If you've noticed that xl2007 still has the bug, then I don't know of any plans
to address the problem.

In fact, maybe someone running xl2010 will take the time to test it and report
back with their findings????



Stefi wrote:
> 
> Thanks, Dave, two windows is an essential part of my present project, I'm
> going to try Forms toolbar.
> 
> I use Excel2003, do you have any information on fixing this bug in Excel2007?
> 
> --
> Regards!
> Stefi
> 
> „Dave Peterson” ezt írta:
> 
> > I think it's an old bug that controls from the control toolbox toolbar won't
> > work when there are two windows into the same worksheet--the commandbutton in
> > the top window works, but the commandbutton in the bottom window doesn't (for
> > example).
> >
> > Maybe you could replace the commandbuttons from the control toolbox toolbar with
> > buttons from the Forms toolbar.
> >
> > (Or remove the window????)
> >
> > Stefi wrote:
> > >
> > > Hi All,
> > >
> > > I I have more than one window of a workbook, buttons work only on window No.
> > > 1.
> > >
> > > Can it be achieved somehow that buttons work on other wondows, too?
> > >
> > > --
> > > Regards!
> > > Stefi
> >
> > --
> >
> > Dave Peterson
> > .
> >

-- 

Dave Peterson
0
Dave
12/14/2009 1:38:21 PM
On dec. 14, 14:38, Dave Peterson <peter...@verizonXSPAM.net> wrote:
> I don't use xl2007 to know if the bug has been fixed in xl2007.
>
> If you're looking for an answer, then maybe someone running xl2007 will c=
hime
> in.
>
> If you've noticed that xl2007 still has the bug, then I don't know of any=
 plans
> to address the problem.
>
> In fact, maybe someone running xl2010 will take the time to test it and r=
eport
> back with their findings????
>
>
>
>
>
> Stefi wrote:
>
> > Thanks, Dave, two windows is an essential part of my present project, I=
'm
> > going to try Forms toolbar.
>
> > I use Excel2003, do you have any information on fixing this bug in Exce=
l2007?
>
> > --
> > Regards!
> > Stefi
>
> > =84Dave Peterson=94 ezt =EDrta:
>
> > > I think it's an old bug that controls from the control toolbox toolba=
r won't
> > > work when there are two windows into the same worksheet--the commandb=
utton in
> > > the top window works, but the commandbutton in the bottom window does=
n't (for
> > > example).
>
> > > Maybe you could replace the commandbuttons from the control toolbox t=
oolbar with
> > > buttons from the Forms toolbar.
>
> > > (Or remove the window????)
>
> > > Stefi wrote:
>
> > > > Hi All,
>
> > > > I I have more than one window of a workbook, buttons work only on w=
indow No.
> > > > 1.
>
> > > > Can it be achieved somehow that buttons work on other wondows, too?
>
> > > > --
> > > > Regards!
> > > > Stefi
>
> > > --
>
> > > Dave Peterson
> > > .
>
> --
>
> Dave Peterson- Id=E9zett sz=F6veg elrejt=E9se -
>
> - Id=E9zett sz=F6veg megjelen=EDt=E9se -

Thanks, Dave I'll wait for an answer from an XL2007 user. XL2010 is
far away yet.
0
Stefi
12/14/2009 2:01:34 PM
Reply:

Similar Artilces:

Do not Email Button
Folks, can anyone tell me if there is a way to insure that a contact marked as do not email, using the radio button on their record, does not get emailed? thanks Pat No this does not work consistently throughout the system. I believe it has been logged as a bug but no resolution has been provided as far as I am aware. "Phifunk" <Phifunk@discussions.microsoft.com> wrote in message news:DD32EE5B-4BCD-419F-BA5E-FBE7A31843E1@microsoft.com... > Folks, > > can anyone tell me if there is a way to insure that a contact marked as do > not email, using the radio button...

Option Buttons/Radio Buttons
Hi I run Excel 2000 I have 2 option buttons in each row (total of 20 rows) I would like the only one of the 2 buttons in each row are on or off. The problem I am having is that it dosent matter which button on which row I select, only that button is active. All the other buttons go blank. I have tried changing the source for each pair of buttons but when I do all the other button sources change as well. How do i set up the buttons so that I can select one of the 2 in every row.? Example 20 buttons in total - 10 buttons active and 10 buttons inactive Thanks John You have to grou...

Windows wont start with USB printer plugged in
I have now got two club members that can not start Windows if their USB printer is connected. In both cases the computer goes to the BIOS splash screen and freezes. In one case it is a Dell Computer with an HP printer. In the second case it is an HP Computer with an Epson printer. If you remove the printer USB cable, the computer starts and load the desktop just fine. Then you can plug the printer cable in and use the printer computer and printer. But if the printer USB cable is connected, printer power off or on, then the computer go to the BIOS splash screen. Dell in one case,...

Moving a Button in a Dialog
I want to move a button in a dialog window but cannot, below are the steps that I am taking when the user makes the BN_CLICKED command CButton *pBtnOK = (CButton *)GetDlgItem(IDC_BTN) pBtnOK->GetWindowRect( &Rect ) Rect.left += 1 Rect.right += 1 pBtnOK->MoveWindow( &Rect, TRUE) Thanks in advance. Rahvin wrote: > I want to move a button in a dialog window but cannot, below are the steps that I am taking when the user makes the BN_CLICKED command: > > CButton *pBtnOK = (CButton *)GetDlgItem(IDC_BTN); > pBtnOK->GetWindowRect( &Rect ); > Rect.left +...

Settings Button , Customize Button and Service Calendar
Here are the links you can put inside the outlook client to access this menu's inside outlook without having to use the web client to make the changes in your organization Just creat a new folder in the CRM structure ( or not ) , in the properties windows ( homepage ) Insert the following info. Settings http://crm:port/tools/home_tools.aspx?pid=0 System Customization http://crm:port/tools/systemcustomization/systemcustomization.aspx?pid=0 Service Calendar http://crm:port/sm/home_apptbook.aspx You have to creat a folder for each link . Im using this , i dont know if microsoft recommen...

Missing Send Button #3
My kids messed up something in Outlook. I have XP Hmoe and office 2000. My outlook works fine (under my user) but my wife's is now missing the send button in the toolbar. Thus seh cannot send emails. I cannot check the response toolbar under customize. Do I need to uninstall then reinstall or is there a way to fix it without having to do that? Thanks for any help anyone can offer. Is her mail account installed and working? Does reinstalling the account clear up the situation? --� Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. D...

VB to search a value in an array from a sheet then write another c
I have problem that has bugged me for the last 2 weeks which looks like can not be handled by excel function, since excel formula can not facilitate to write a value to another cell. # Condition -> workbook consist of 5 sheets --> sheet1 contain list of text composed of 4-5 characters (AAAA, ASDF, ABCD3, ...etc) listed vertically ....|...A...| 1 | ASDF 2 | AHGI9 3 | AERT 4 | ... .... --> sheet2 contain list of 4-chars possibilities from AAAA-AZZZ. [] A.......B.........C ========================================== 1|......|...A...|...B...| ... ----------------...

Active Window becomes inactive
Dell Inspiron, Vista home prem. This happens very occasionally. Working in a window, pause for a few seconds and the title bar dims and and the window becomes inactive and another open window title bar or a desktop icon will become highlighted ("active"). I have to mouse click in the window I was working in to reactivate it. This will keep repeating until I reboot. Any ideas on why this is occurring and how to keep it from happening in the future? There's a setting in ControlPanel-->Mouse-->click one of the tabs, don't remmeber which, which con...

Radio Button
I have a form someone created in Excel and somehow three buttons are linked together so that if I click on one, it selects the one I click on and clears one selected before. Is there a way to have it clear the button that was selected if I click on the same button again. As it is, I cannot clear all the buttons once a button is selected. Hi This is what radiobuttons (option buttons) are for. Either Male or Female, no None or Both or Not sure yet or Refuse to answer. For independent choices (Vegetarian, Blonde, Plays guitar, ... ) use checkboxes. HTH. Best wishes Harald "Debb...

Buttons Issue with Access 2007 on Vista
Hi there! I have a client who has a simple access DB. If he runs it onXP/Access 2007 no issue, but if he runs it on vista/access2007, he can't click any of the buttons on any of theforms! Could someone shed some light please?...

Identities in Windows Mail?
I've missed the ability to have different email identities ever since Windows Mail replaced Outlet Express. Now, however, it's gone beyond nostalgia to necessity. I really need the ability to access a couple of different mail accounts and keep them separate. The "different user accounts" is not an option as far as I'm concerned. The simplest solution that I can see is to use WinMail as usual and use another email reader like Thunderbird to read the other account. Is there any simple option using WinMail that I'm not thinking of? TIA! Gary Visit...

Another one mistake, sorry
Sorry, I found that there is an error in the application log on exchange server But the messages still do not route Event Type: Error Event Source: MSCRMExRouter Event Category: None Event ID: 0 Date: 21.02.2007 Time: 17:15:35 User: N/A Computer: EXCH01 Description: Microsoft.Crm.Tools.ExchangeConnectorService.ExchangeSinkServiceException: Delivering message: Re: почта1 CRM:01290051 in mailbox: crmsales failed (System.Web.Services.Protocols.SoapException: Server was unable to process request. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage mess...

about transparent window
hello I use SetLayeredWindowAttributes API then the other control(Button or EditBox...) all transparent, but I want the control not transparent,Now,I use UpDateLayeredWindow API then I cannot see any control in my window but can respond message(click..),those all not I want.Please help me thank Show code. joe On Thu, 1 Feb 2007 18:40:00 -0800, zola <zola@discussions.microsoft.com> wrote: >hello > I use SetLayeredWindowAttributes API then the other control(Button or >EditBox...) all transparent, but I want the control not transparent,Now,I use > UpDateLa...

Adobe Reader for Windows XP64?
Which version of Adobe Reader should I be using for Windows XP64? The Adobe site is not specific and there does not appear to be a viable way to ask. Thanks Bob AZ The 32-bit Adobe Reader version 9.3.0 will install and run on all x64 version of Windows. Also check out the information @ http://www.pretentiousname.com/adobe_pdf_x64_fix/index.html On 2010-02-08 17:21, Bob AZ wrote: > Which version of Adobe Reader should I be using for Windows XP64? > > The Adobe site is not specific and there does not appear to be a > viable way to ask. > > Thanks &...

Changing the window size of a CFileDialog-derived class
I have a CFileDialog-derived class that sizes itself when displayed. My problem is that if I open a normal CFileDialog afterward in the same application, that normal CFileDialog has the same enlarged dimensions as my derived class. My hack is to override the CFileDialog::OnFileNameOK() function and reset my derived CFileDialog back to the original dimensions before the dialog is destroyed. Maybe there's a more elegant way, but this seemed the only way I could get it to work, that is when I display another "normal" CFileDialog later in the same app, the dialog dimensions are back...

Outlook Custom Button
Hi All, Is there a way to add a custom button to Outlook 2003 SP-2 standard tool bar and have it replicate to all the users in the domain? Thanks CG You'd need to add it using a script or vba and push it out via a logon script. -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outlook 2007: http://www.slipstick.com/outlook/ol2007/ Outlook Tips by email: dailytips-subscribe-request@lists.outlooktips.net Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Cen...

Moving SQL Databases to another drive results in error
I am trying to move the CRM SQL Databases to another drive that has more space and I get a replication error. Is there any documentation to help me move these successfully?? McKenzie This is a multi-part message in MIME format. ------=_NextPart_000_005D_01C5A44F.29F39C90 Content-Type: text/plain; charset="Utf-8" Content-Transfer-Encoding: quoted-printable you can do this but you need to disable replication and re-enable = afterwards Use SQL Enterprise manager, select the database you want to move and = then=20 choose the option (after right click) to detach the database,then ...

Folder icons change when moved to another computer
I've changed the folder icon of several folders. When I move them onto a data CD they remain as I changed them. But when I open the CD on another computer they revert to the old yellow default folder. How do I get them to keep the changes? On another forum I was told to place that icon file into that particular folder (no problem) and to create a "desktop.ini file" and make it a system file (problem). I'm not a programmer. No one responds with exactly how that is done. Can anyone help with basic - "beginner" steps? "MW" <changeabl...

Superscript Button and Subscript Button
I am trying to customize my toolbars, and I can't seem to find the superscript or subscript command. Is there a way to make the superscript and subscript commands into a button in Excel? "=?Utf-8?B?U2xvdGg=?=" <Sloth@discussions.microsoft.com> wrote in news:3D6FC2A9-56DD-49DD-B2A3-0DC028A12184@microsoft.com: > I am trying to customize my toolbars, and I can't seem to find the > superscript or subscript command. Is there a way to make the > superscript and subscript commands into a button in Excel? > Record a macro for each and tie them to buttons. ...

VS C++ 6.0 hanging problem in Windows XP ...
Hi, My VS C++ 6.0 has worked fine for 4 years. Recently I upgraded my os from 2000 to XP. Now my VS C++ 6.0 sometimes just hangs forever after I make a build command. From the output window I know it's linking. Nothing happens if I stop the building (ctrl-break). If I exit, it says that I have to stop building before exiting. Eventually I have to go to the task manager to kill the process. This situation takes place for any of my projects. Not always, but often enough to affect my work. Do you have any idea what is happening or is there any resolution? I have already rein...

Problem with VBA code on command button
I have a form that has a combo box to select a month. The name of the combo box is txtmontha (I realise it would have been better to name it cmb???) The is a command button that when clicked should open a form where the date selected from the combo box is the same value as the date on the form. Here is the code behind the command button: Private Sub cmdopenrecord_Click() On Error GoTo Err_cmdopenrecord_Click Dim strqtr As String strqtr = Me.txtmontha.Value Forms!frmMain!SubForm1.SourceObject = "frmFDA" Forms!frmMain!SubForm1.Form.RecordSou...

making one cell equal another cell and having the pointer stay fix
I want to make one cell equal another cell. For example I want cell A1 to equal cell B1. In cell A1 I type '=B1'. Then I enter a value in B1 and I see the value I typed in A1. But when I moved the value in B1 to another cell, the formula in A1 automatically changes to point at the cell that I moved the contents in B1 to. Is there any way I can prevent this? thanks Hank You always want to retrieve the value in B1? =indirect("b1") Hank wrote: > > I want to make one cell equal another cell. For example I want cell A1 to > equal cell B1. In cell A1 I ty...

Recording a command button name
I have an application where the user is prompted to save when they leave the the data entry form either by previewing a report of the data or by closing the form completely. There are two buttons a user can use to do this cmdPreview or cmdClose. I use a module to promt the user for svae. What I would like to do is differentiate to the module which button was clicked. Is there a way to do this? thanks You could take a look at Screen.ActiveControl.Name -- Doug Steele, Microsoft Access MVP http://www.AccessMVP.com/DJSteele (no e-mails, please!) "E" <...

ActiveX Option Buttons
:confused: Hello, I need to know how to tell an option button what value to return. I have a group of 4 option buttons and I have linked them all to th same cell. That's when they stop working, because they all want to say 'true' o 'false' - how do I get them to return a value instead (i.e. 1-4) so can do a calculation on the value in the linked cell? Please help -- veci ----------------------------------------------------------------------- vecia's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=211 View this thread: http://www.excelfor...

Windows Desktop Search
Bom dia ! Como posso remover o Windows Desktop Search, uma vez que n�o surge no "adicionar ou remover programas" ? Estou a usar um Windows XP Professional. Boas, Na janela "Adicionar/Remover Programas" encontras do lado esquerdo uma opção que te permite remover actualizações do sistema operativo. Clica aí, localiza a entrada referente ao Windows Desktop Search e remove-a. --- Jorge Moura [MVP] http://ojmoura.spaces.live.com http://360.yahoo.com/jorge_moura "Alvega" wrote: > Bom dia ! > > Como po...