ActiveX Command Buttons - Dont Stick In The Same Place?
Jan 7, 2010
how to get some command buttons to stick in one place? I currently have two in a summary sheet. Each button runs a similar code which clears and deletes (by shifting cells upward) at the start of the process, then populates data.
It's rather annoying though that I cant have the buttons stick to one zone, they end up moving left or right depending on which button I press. Each report also changes column sizes, dont know if that's relevant?
View 3 Replies
ADVERTISEMENT
Feb 22, 2008
On a worksheet, I have several commandbuttons. For many of the buttons the name in the "name box" is different than the name in the "(name)" field under Properties.
Researching this, I found this on msdn2.microsoft.com:
An ActiveX control on a sheet has two names: the name of the shape that contains the control, which you can see in the Name box when you view the sheet, and the code name for the control, which you can see in the cell to the right of (Name) in the Properties window. When you first add a control to a sheet, the shape name and code name match. However, if you change either the shape name or code name, the other isn't automatically changed to match.
So, in my case, one button has:
In the name box: "CommandButton5"
In the (name) properties field: "RunProcess"
The real problem arises when I'm using code to loop through the objects on the worksheet, and build an array of the object names. I'm trying to match the name of the buttons to their click events. In the code, "btn.name" returns the name found in the "name box". The one that I want is the name in the "(name)" field under properties because this is the one that matches the click event.
How can I determine, in code, what is entered in the "(name)" field for an object?
View 5 Replies
View Related
Jun 27, 2014
I want to be able to call one user form from multiple ActiveX command buttons. The problem is, the number of command buttons depends on user input on another worksheet, so it's variable.
I've renamed all of the command buttons so they are named "CommandButton" & i, where i is an integer between 1 and, say, 200. I want each of these buttons to direct to the same UserForm where additional information can be entered.
I can't think of a way around the event-handler procedure name.
Sub [Command Button Name]_Click
to call the User Form. I won't know the command button names, because I won't know how many there are (max i) until the user inputs.
Basically, I want to create a For loop through the max i and have the event-handlers call the user form
View 14 Replies
View Related
Mar 14, 2007
Is it possible to change the color of buttons or command buttons? There does not seem to be any place that allows this under properties for buttons, although there does for command bars. However, I've tried recording a macro as I change the color, but nothing get's recorded so I'm not sure what the syntax would be.
I have a spreadsheet with several buttons and I'd like them to change colors as they are pressed so it's possible to see what you've already done. And then, as soon as any other cell on the sheet is changed, the buttons reset color.
View 9 Replies
View Related
Mar 19, 2014
I am looking for a way to use 2 optionbuttons in vba. The option buttons are in different groups, and are independent.
I cannot get this to work. Is this even possible? In sheet1, the vba would read something like this.
View 9 Replies
View Related
Feb 24, 2013
I have several Activex buttons in sheet "Options" and I would like to automatically assign each button to the same macro "Run_Options", in order to execute the macro "Run_Options" when I do click over any button.
How can I do that with a excel macro?
View 2 Replies
View Related
Jun 10, 2014
I want to write a VBA code that will place ActiveX Frame directly onto the worksheet and then add 3 Option Buttons from Toolbox into that frame.
I could not find an answer searching through the web... Also when trying to record macro and see the code it did not record placing the buttons from the toolbox or any formatting (color, caption, etc.) via properties...
When formatting the buttons it would be useful if the selected radio button would have different color, bold font, etc.
View 5 Replies
View Related
May 22, 2014
I was re-reading Chnadoo's thread below on using a hyper link to drive a formula, and was wondering if there was a way to do the same thing with shapes. Interactive Dashboard in Excel using Hyperlinks | Chandoo.org - Learn Microsoft Excel Online I tried doing it where I used a hyper link on each shape to link to a cell containing a number, that in turn would be picked up by the cell that I would want to be incororated in to an INDEX function.
Let's say cells A2 to D2 contain the numbers 1 to 4. Cells B3 to D3 have an oval shape which are each linked to the cell above it by a hyperlink.
Upon selecition of any of the shapes I was trying to get the corresponding number to appear in cell P1 by way of very basic VBA. I was trying to get it to pick up the number by way of referring to the ActiveCell, but cell P1 wouldn't update automatically upon each selection of a new shape.
I know there are other ways to get what I want with scroll bars, spin buttons etc but I'm interested to know if it can be done with shapes.
View 1 Replies
View Related
Aug 12, 2009
I have created an ActiveX command button and the text on the button looks crude. I know that is not very descriptive but I am unsure how to describe it. The text looks jagged and some letters are missing chunks of their letters. The font I have chosen is Calibri.
If I create a Form Controls button I do not have this problem but I want the button to have a particular background color so I do not believe I can use a Form Controls button.
I do not know why the other Calibri text on the worksheet looks fine while the ActiveX Calibri text does not. The attached image shows the two buttons with the top one being the ActiveX button while the bottom is a Forms button.
View 11 Replies
View Related
Aug 22, 2008
i create new sheet on button click event using this code
Worksheets.Add before:=Sheets(Sheets.Count)
ActiveSheet.Range("A1").Value = TextBox1.Value
but now i want that when this new sheet will open there will be some labels, textboxes and buttons n etc will be appear on that sheet so how can i display these elements on new sheet dynamically ??
View 9 Replies
View Related
Aug 26, 2013
I have made an excel workbook detailing team performance that all of my team have access to and that requires updating once a day. The first person to access the workbook each day presses a Command Button that updates the workbook and inserts a time/date stamp. However, other members of the team go into the workbook and update it again the same day which then affects the data being reported.
I know i should probably just sack them for not being able to read the time and date but HR would not like that so is there a way to disable CommandButton1 (ActiveX) so that once it is pressed it is disables until the next day?
View 3 Replies
View Related
Dec 30, 2009
I designed my spreadsheet incorrect.
Everything works good. But when I selecting tables with listbox, I forgot to notice that there also comboboxes.
I mean, rwgrietveld, I use selecting table to hide 'em, but when I hide 'em comboxes should also disappear (become invisible).
is it possible at all to make invisible activex commandbutton in selection?
View 11 Replies
View Related
Jun 15, 2014
well, the clear worked well and now I have another idea for a button for my worksheet;
I want the button to insert values from other cells. so when it is clicked, the values in cells F82-F86 are entered in cells E19 - E23.
View 5 Replies
View Related
Feb 6, 2014
I have a workbook with two worksheets, "Main" and "Control".
Both of them are with hidden tabs (unchecked "show sheet tabs").
On worksheet "Main" I have command button which opens worksheet "Control".
The assigned makro is: Sheets("Control").Select
The problem is: when I open "Control" and close after that the workbook, the next time when I open the workbook "Control" pops-up instead of "Main" even though I do not save it.
1. I need macro on "Main" which will allow me to open "Control".
2. Regardless I "Save" or "Don't Save" "Control" when selected and workbook is closed, to open the workbook always displaying worksheet "Main".
I use Excel 2007 (at home) & 2010 (at office).
View 1 Replies
View Related
Jun 4, 2012
I'm making a Userform for commands I use a lot, like concatenation and highlighting cells. I placed a command button on the sheet that pops up whenever I open Excel. It's a bit awkward to have it on the sheet. Is there a way to place the button on the ribbon to get it out of the way? (I'm on an intermediary level with VBA
Another alternative would be to make a hide button on the userform, I guess. Once it disappears though I'd probably need another button to call it up again.
View 5 Replies
View Related
Apr 9, 2009
I have a range of cells (A1:D5) identified within a worksheet (worksheetA) as part of a user input form.
When a certain condition exists, a routine is executed that copies a range of cells (C1:F5) from another worksheet (worksheetB) to this defined range. The copied area consists of two command buttons. They get copied and pasted no problem.
When I want to reset (blank it out of its contents) my range in worksheetA from I copy another range over of just a range of blank shaded cells. However, doing this does not eliminate the command buttons left in the range on previous pasting.
How do I delete these command buttons left from previous pasting activities when I wish to reset my range?
View 9 Replies
View Related
Jan 17, 2014
I have been having an internal debate of how my worksheets shoud be configured.
My workbook could potentially contain 300+ worksheets, 10 control buttons and around 20 macros.
Each worksheet contains data in a range ~ A1:AC40 with many blank cells.
Do you think a workbook with this many worksheets would be unmanageable given the Comp Spec of the user PC below?
Most of the cells are simply short text data.
System info
Processor: 2.3Ghz Dual Processor
RAM: 2GB
32bit
View 7 Replies
View Related
Feb 3, 2009
i try run macro with commandbutton, but it doesnt work. I insert button from "control toolbox" then i create a macro. Then i wrote this macro to "Private Sub" but it still doesnt work.
When i click on button, it only open editing macro, or select the button.
View 6 Replies
View Related
Aug 28, 2009
I made a userform to calculate the net weight of a package by taking the gross weight and deducting the amount of boxes included in the package. The most boxes possible is 25, so I used 25 command buttons numbered 1 to 25, so users only have to press the desired amount of boxes for the calculation to begin.
But that also means I've got 25 subs containing the same formula, and that's a bit much. I'm pretty sure this could be done more efficiently,
View 3 Replies
View Related
Sep 9, 2009
I have a multiple of command buttons that I want to make visible. I have the following code which I am trying to get to work. Maybe I am barking up the wrong tree.
View 2 Replies
View Related
Jan 4, 2008
I can't write macros, so have to create them by actually recording the process. I did that just now and then copied it into the Command button. When I run it from Tools>Macros, it works, but when I run it using the Command button it fails.
I'm trying to copy and paste values current MTD figures (P18:P39) to previous MTD area (W18:W39), but the command button fails at this selection. Cells 28-35 are blank, but I don't think this makes any difference, as I've tried the command button with those cells zeroed out.
This is what I recorded initially; this works from Tools>Macros
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 04/01/2008 by Lucertola
'
'
Sheets("Reconciliation").Select
Range("P18:P39").Select
Selection.Copy
Range("W18").Select.....................
View 9 Replies
View Related
Sep 10, 2008
I have a workbook with some command buttons that I created a while back. The buttons used to work fine. But after installing a new computer, the spreadsheet no longer works. I can step through the code fine, but when I try to click on the button, nothing happens.
View 9 Replies
View Related
Aug 17, 2006
Is it possible to create a number of command buttons, depending on the number of lines on a worksheet, and then have the code attached to the command buttons execute based on the position of the buttons on the sheet. For example, if I have a button positioned over, say A3, can the code execute based on the content of another cell in the same row. I imagine that the button would have to be linked to the cell, but I cannot see how that is achieved.
View 8 Replies
View Related
May 25, 2007
i am trying to access buttons like ' Format - Column - Hide'
View 5 Replies
View Related
Aug 23, 2007
I was creating command buttons and had trouble using the linked cell. I found an example on the forum here but the command buttons seem to have many different behaviors. On the attachment, "Button 1" and "Button 2" are the ones I created in Excel 2003. "Button A" and "Button B" are from an example I found on the forum.
1 and 2 can only be edited on design mode, and have the formula "=EMBED("Forms.OptionButton.1","")" by default (which yields an error when exiting the formula field). A and B can be edited at any time, and have an extra tab ("Control") on the Control Format dialog. This seems to allow the linked cell to be set and function pretty handily. Are A and B from a different version of Excel? Auto Merged Post;Here's the attachment:
View 3 Replies
View Related
Jul 8, 2013
I have 3 cpmmandbuttons in a spreadhseet named "Controls" . viz
Trim and Edit Base DataCreateReportArchive
They are always run in the same order.
My Aim is to disable and gray out the Archive button once its assigned macro is run(by clicking it) so that it activates only next time that the workbook is opened.
View 9 Replies
View Related
Feb 15, 2010
In the attached workbook there is a UserForm with five (5) command buttons along the bottom of the UserForm. I'm familiar with making them the same size and aligning tops. What I'm struggling with is how to distribute them horizontally. That is, to get the same amount of "white space" between them.
View 9 Replies
View Related
Sep 21, 2008
I need to get the code for a "copy" command button and "select all" command button. I need both for a text box.
Scenario: I click on the "select all" command button, it selects whatever is in the text box and then the "copy" command button copies all of that. So then I would be able to paste that in another program.
View 6 Replies
View Related
Feb 26, 2009
Does anyway to use a scroll bar to priortize a selected range?
I have included a simple example that I would like to rearrange with a scroll bar.
For example, I would want be able to select one row in the range and then place it either above the current position or any where in that range.
View 13 Replies
View Related
Jan 13, 2010
I have I command buttons on the sheet and when I delete a row, the postiion of the buttons is changing. Can I make it somehow so they never move when I add or delete rows?
View 2 Replies
View Related