Run A Button From Another Button From A Different Worksheet

Feb 8, 2010

i'm using excel 2003 SP2. I have several sheets with the same buttons. And i have a final sheet where I collect a summary from every sheet. I want to create in my summary sheet a button that runs all the buttons from the other sheets, so i can get all the info.

View 3 Replies


ADVERTISEMENT

Click The Master Button, That Would Click Another Button On A Different Worksheet

Oct 22, 2008

Running into this issue of "transworksheet macros"

I have a master "update" commandbutton on sheet 1. I have two sub "update" buttons on sheet 2 and 3 respectively.

What I would like to do is have the user click the master button, that would "click" the two sub buttons so they run their respective macros on their respective worksheets (within the same worksheet.

I have tried pasting the macro code in the master button, telling it to select the sub worksheet and then run the macro, but the marco runs itself on the master worksheet instead.

View 6 Replies View Related

Toggle Button Pressed - Change Color / Highlight Button?

Nov 11, 2011

I have a togglebutton for an excel sheet in use for scoring psychological tests. When pressed, the button higlights the cells where a raw score is inserted.

What I need is a code to higlight the togglebutton when pressed, eg. green (colorindex 4). The button is white. How to do this?

Below is the code, It has more lines than needed, but it works.

Private Sub ToggleButton1_Click()
'FKV TOGGLE'

ActiveSheet.Unprotect "manisk"
If ToggleButton1 Then

[Code] ........

View 2 Replies View Related

Reference Cell Based On Button Location & Determine Button Used

Mar 7, 2008

I received this code from an example I found once upon a time that was originally submitted by someone else. Right now the code enters the current date in a cell of the same row as the checkbox when it's checked. I need to revise it, or come up with something similar, that will reference the value of a cell when it is in the same row as the button (from the Forms toolbar) that is clicked to activate the macro. First of all, I don't know how to reference a Forms button in VBA.

Sub Process_CheckBox()
Dim cBox As CheckBox
Dim LRow As Integer
Dim LRange As String
LName = Application.Caller
Set cBox = ActiveSheet.CheckBoxes(LName)
' Find row that checkbox resides in
LRow = cBox.TopLeftCell.Row
LRange = "B" & CStr(LRow)
'Change date in column B, if checkbox is checked
If cBox.Value > 0 Then
ActiveSheet.Range(LRange).Value = Date
'Clear date in column B, if checkbox is unchecked
Else
ActiveSheet.Range(LRange).Value = Null
End If
End Sub

Here is some other code I already created. Unfortunately, because I don't know how to do the row reference, I had to create 25 different macros, which just bulks up the size of my file and slows it down. But here is what I'm trying to accomplish in my macro:.............

View 8 Replies View Related

Command Button Click Creates New Rows Above Button?

Nov 8, 2012

I currently am using a form button to create new rows.

I need two different kind of buttons. I have a button that does this-

VB:
Sub InsertRow()
'this inserts a row where the button is clicked.
Dim r As Range

[Code]....

However, when I try and create these codes using a Command button (I need it for the color), I get the error

"unable to get the buttons property of the Worksheet class"

P.S one other thing, say the button is in row 3, and Cells A1 and A2 are merged, when you click the button in row 3, it should extend the merge to A3.

View 4 Replies View Related

Command Button - Create A Save Button In Sheet 1?

Mar 9, 2013

i want to create a save button in sheet 1, on clicking the same the data entered in the particluar cells of sheet 1 should get saved in sheet 2 in given format

View 1 Replies View Related

Assigning Macro To Each Button To Zip Files Dependent On Button Name?

Jan 28, 2014

Context: I have a spreadsheet that contains a list of employee names and their certifications. I want to be able to assign a button to each employee in column B with a macro that is able to zip files from a folder that contains that employees name.

The following code assigns buttons to each employee in column B. At the moment the code I have is able to assign the macro "Zip" to each button.

[Code] .....

Now, this Zip macro is able to zip the file for the employee "Anthony Tran". However I need it to be able to recognise which employee's button I've clicked and search the same files as above except with that employees name instead of "Anthony Tran".

If it makes things easier, the code for creating buttons for each employee is able to name that button as the employees name that it represents.

View 6 Replies View Related

Macro Works With Form Button But Not Command Button

Oct 5, 2006

This is probably really straight forward but cant see why it happens, the following macro works fine when called by a button created by the form toolbar but doesnt when called by a command button, get the runtime error 1004, "select method of range class failed"

ActiveSheet.Select
Range("B4:B37").Select
Selection.ClearContents
Range("G4:G37").Select
Selection.ClearContents
Range("B1").Select
Selection.ClearContents
Range("D1").Select
Selection.ClearContents
Range("F1").Select
Selection.ClearContents
Range("J1").Select
Selection.ClearContents
Range("M2:M3").Select
Selection.ClearContents
Range("B4").Select
ActiveWorkbook.Save
Application.Quit

View 2 Replies View Related

Macro To Button To Zip Files Dependent On Button Name

Jan 29, 2014

Context: I have a spreadsheet that contains a list of employee names and their certifications. I want to be able to assign a button to each employee in column B with a macro that is able to zip files from a folder that contains that employees name.

The following code assigns buttons to each employee in column B. At the moment the code I have is able to assign the macro "Zip" to each button.

VB:

[COLOR=#333333]Dim Btn As Button[/COLOR]
[COLOR=#333333]Dim rng As Range[/COLOR]
[COLOR=#333333]For I = 2 To RowCount + 1[/COLOR]
[COLOR=#333333]With Worksheets("Sheet1")[/COLOR]
[COLOR=#333333]Set rng = .Range("B" & I)[/COLOR]
[COLOR=#333333]Set Btn = .Buttons.Add(rng.Left, rng.Top, rng.Width, rng.Height)[/COLOR]

[Code]....

The following code is my Zip macro:

VB:

[COLOR=#333333]Sub Zip()[/COLOR]
[COLOR=#333333]Dim strDate As String, SavePath As String, sFName As String[/COLOR]
[COLOR=#333333]Dim oApp As Object, iCtr As Long, I As Integer[/COLOR]
[COLOR=#333333]Dim vArr, FileNameZip[/COLOR]
[COLOR=#333333]Dim FName() As Variant[/COLOR]

[Code]...

Now, this Zip macro is able to zip the file for the employee "Anthony Tran". However I need it to be able to recognise which employee's button I've clicked and search the same files as above except with that employees name instead of "Anthony Tran".

If it makes things easier, the code for creating buttons for each employee is able to name that button as the employees name that it represents.

View 2 Replies View Related

Form Button On Spreadsheet - Identifying Which Row The Button Is On

Jul 23, 2014

I am imagining a spreadsheet with the equivalent of an info button in each cell of column A. The idea is the user clicks the button to open a User Form containing additional info about the entitity represented by values on that row.

E.g., Row 1 is labels, row 2 is all about Bob, 3 is about Jane, 4 is about Freddy. If the user clicks the info button on row 3 then a user form opens up and displays additonal info about Jane.

I am wondering if there is a way for VB to identify which row the clicked button was on without having to write individual code for each button telling VB which row the button was on.

I am hoping there is some form button property I can reference or interrogate which will give me a cell address; a button.position property or similar. This will obviously save me a lot of coding if VB can dynamically determine which row is being interrogated as there will be a couple of hundred of these to start with, potentially thousands. (I realise Access is a better solution for database interrogation, but I have to work with excel at present).

Ultimately, the user form that the button calls up will have a list box on it and I want the list box to default to the entity on that row, and allow the user to browse the other entities if they want to.

If there isn't a solution for this I will just have a single info button for the users to click that opens the user form and then they can select the entity from a list box. But I would like to offer the "intelligent display" option but don't relish coding the equivalent of several hundred "You clicked button four hundred and seventy six, default to info card for bert".

View 4 Replies View Related

Running The VBA That Is Assigned To Multiple Cmd Button On One Cmd Button

May 19, 2009

I have a workbook that contains 18 sheets, on 14 of the work sheets I have a comand button that runs the following
Private Sub CommandButton1_Click()
' Range("B3:B53").Select
' Selection.ClearContents

Dim nloop As Long

Range("C3:K53").Select
Selection.Copy

Range("B3:J53").Select
ActiveSheet.Paste

For nloop = 3 To 53

If nloop 3 And nloop 12 And nloop 15 And nloop 16 And nloop 23 And nloop 28 And nloop 41 And nloop 47 Then Range("K" & nloop).Value = 0

Next nloop

Range("B2").Value = DateAdd("d", 7, Range("B2").Value)
Range("L7").Select
End Sub
I want to put a comand button on sheet18 that will run the code so it does the same thing as pressing each command button on each sheet.

the sheets that I have the cmd on are:
Sheet1, Sheet2, Sheets3, Sheet4, Sheet5, Sheet6, Sheet9, Sheet10, Sheet11, Sheet12, Sheet13, Sheet15, Sheet16, Sheet17

View 9 Replies View Related

Toolbar Command Button As Toggle Button

Aug 13, 2008

I have read several articles saying using a command button as a toggle button can't be done but some articles have said it is possible using the state properties.

.State = msobuttondown
.State = msobuttonup

Is there any way to combine this with the onaction property so that when you press the button, it stays down and activates a macro then when you press it again it pops back up and activates another macro.

View 8 Replies View Related

Hyperlink Button To Another Worksheet

Dec 27, 2008

I have an existing button which has either a macro or hyperlink assigned to it which links to another worksheet within the workbook. I would like to change the worksheet it is linked to. I have tried right click - edit hyperlink and picked a different sheet, and also assign macro - record new macro. I have even removed hyperlink, then inserted new but no matter what it still goes back to the same sheet.

I am in this position after copying and pasting an existing button. I'm not sure how they designed it from scratch so I would really prefer to just change the link.

View 2 Replies View Related

A Button To Switch To A Worksheet

Jul 13, 2008

I have made a little program for a customer at work which has 4 different worksheets.

Each worksheet works out a cost based on different prices.

I would like to make a 'Welcome' worksheet, with buttons on it so my customer can click the button which corresponds to the option he would like to cost, and then excel automatically selects that worksheet.

how to create buttons but don't know the code to but behind it. It would be nice to also hide the other 3 worksheets when they have not been selected by the welcome page.

View 9 Replies View Related

Create A Button In Worksheet

Jul 26, 2008

creating a button (using VBA code) in a excel worksheet that can initiate a range of output data in a col (say (C1:C100)) by activating the therein formula of each cell (same as what F2 does) and then entering the cell.

Actually I have to do manually each time for each output cell after opening the worksheet that I don't want.

View 9 Replies View Related

Set Worksheet Button Properties

Oct 28, 2008

I have a button on a worksheet that activates a macro, the macro is stored in a "personal.xlsb" file. This file is copied to several users computers so they can use the macro, problem is once the button is assigned to a macro from one computer all the other users can't use the macro. What can I do to make this macro work on all computers? (Less placing yet another button on the tool bar).

View 2 Replies View Related

Macro For Button On Worksheet

Apr 6, 2009

I am trying to make a button that puts the formula back into the cell after a manual entry

View 3 Replies View Related

Locating A Button On Worksheet

Dec 24, 2012

I want to assign macros to buttons from VBA. I know that buttons have a TopLeftCell property and I've used this before to point at cells around the button but not the other way round.

What I'm trying to do is have excel assign a macro to a button when the workbook is created (if thats possible - if not then just whenever it's opened the macro can be reassigned).

The recorder gives me the line of code:

Selection.OnAction = "ThisWorkbook.ImportJobsButton"

so I really want to change Selection for something that points at the specific shape. I want to do this with a few shapes.

View 1 Replies View Related

Can I Add A Submit Button To Worksheet

Apr 25, 2007

I'm working on an order form in excel and wondered if someone can tell me if it's possible to add a 'submit button' to a worksheet (order) that would do the following,

1.) print 3 copies (orders) of the current sheet

2.) create a new worksheet in the same workbook with a new order number (a specific cell in the worksheet) one higher than the current one. Also naming the new worksheet with the new order number.

3.) Save the current workbook.

Maybe I'm getting a little ahead of myself here but any help would be much appreciated as I'm really rusty at this...

View 9 Replies View Related

Disable Worksheet Button

Jul 27, 2007

I have buttons on each of my sheets, when one is clicked code is called in my module ("modAPI"), and from that code I wish to disable and enable certain buttons, and/or change the caption of those buttons. However when I try to do:

With ws
btnRefresh.Enabled = False
End With

I get Error 424, Object Required. I've tried recording a macro of what I wish to do, and it gives me ActiveSheet.Shapes("btnRefresh").Select, but this doesn't give me the option to enabled/disable or change the caption of the button.

View 3 Replies View Related

Button Not Accessible Until Another Button Pressed?

Mar 5, 2013

I'm trying to make it so that when I hit one button it unlocks the ability to hit two other buttons. I've been trying to do some OnEvent things but they just haven't been working for me.

Ideally I'd like it so that button B and C look like they shouldn't be pressed, perhaps translucent or grey, before button A is clicked, after that they should turn to another a specified colour.

View 7 Replies View Related

Saving Worksheet As PDF Using Vb On Click Button?

Jul 10, 2014

I've been looking for a way to save a worksheet as a PDF document and place it in a folder in Documents.

View 4 Replies View Related

Placing Button Programmatically On Worksheet

Feb 14, 2014

I have an expanding worksheet and would like to move a button so that it is always near the bottom of the worksheet data. When the button is pressed it reworks the worksheet and adds in some additional rows (up to 10 max). I'd like it so that the procedure also moves the button down keeping it in line with approximately the last row of data but not sure how to do this with vba...

View 4 Replies View Related

Get Index Of A Button Added To Worksheet

Sep 8, 2007

I have created a calendar to enter various locations. At present they are set up using VBA and are called from buttons on the calendar. What I want to do is add a button to the worksheet and then edit its text. I will call a subroutine to use the edited text as the name I want in the calendar. What I cannot figure out is how to return the index of the button have just added so i can alter the button text. I appreciate I could cycle through all the shapes on the sheet but as I do not know the number of the one I have just added I cannot work on the correct one. I suppose I could cycle through all of them and use a carrier to count how many there are then add one to get the latest but that seems very crude not mention time consuming as I allready have 504 text boxes on the claendar.

View 10 Replies View Related

Button/Link On Worksheet To Sort

Jul 12, 2009

I would like to have a button or a link on my spreadsheet that when it is clicked will sort my table with a pre-defined sort.

View 3 Replies View Related

Refer To Worksheet Command Button From VBA?

Jan 5, 2014

I inserted a Command Button ("Button1") in a Worksheet ("Sheet5"). I want to disable this button while the vba is running. How do I refer to this form control from vba?

View 1 Replies View Related

Macro To Print A Worksheet With A Button

May 24, 2007

I am trying to create a simple macro to print a worksheet with a button. The worksheet will have additions/deletions on a daily basis, so it need to adjust accordingly. I cannot figure out how to do the loop macro.

View 9 Replies View Related

Controlling Button Properties On A Worksheet

Nov 2, 2007

I am trying to change the text that appears on a button on a worksheet via a macro. There is only one button on the worksheet so in the macro I use

MyCaption = activecell.value 'Pick up the button text from the spreadsheet
For each sh in activesheet.shapes
sh.caption = MyCaption
'I know this would do all, but only one button as I said
next sh

which generates "Object doesn't support this property or method".

This is strange because if you get the properties box up, Caption definitely shows as a property of a button control.

View 9 Replies View Related

Adding Sort Button To Worksheet

Dec 24, 2008

I have data in several (50+) columns. I want to be able to sort all my data by the column I select with one click. So, I basically want a button over each column that sorts the data by that column. It would be ideal to have the same "Sort" macro that is attached to all the buttons. The macro should somehow know that the column the button is in, is the column to sort by.

View 9 Replies View Related

Command Button To Save My Worksheet As A PDF

Jul 14, 2009

Not to sure if it can be done but i would like to have a button on my spread sheet that once pushed it automaticaly saves my worksheet as a PDF in a selected company folder in my documents.

I know if you go to file and save as PDF, then save in selected folder will work, just looking for a quicker way so my staff just needs to push one button on the worksheet and it does it all. (dummy proofing the form i guess)

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved