I have a table of data which contains company names, the number of high risk policies, number of low risk policies, and the percentage of high risk policies (compared to total policies).
What I want to do is for people to be able to select up to six of these companies and press a button that says 'create graph' and it creates a graph which shows the number of high risk and low risk in a stacked bar, and the percentage on a separate axis as a line. I know how to manually create this graph no problem, but to be able to dynamically create one from selected companies would be awesome.
To start with I have created six drop downs where you can select the company name as I image the macro will need to know which companies' data to look for in the source table.
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
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.
Dim r As Long Dim c As Long Dim s As Worksheet 'Set s = Active.Worksheet( Name) Dim Error As String ' Dim ws As Worksheet Dim ValorMensaje As Long
'Turn off Screen refresh Application. ScreenUpdating = False
'Use Cells(Row, Column) for range adddress r = ActiveCell.Row c = ActiveCell.Column ..................................
How can I simultaneously with this code put data from textboxes to Active sheet and sheet "Izpisi". So when the button Add(dodaj) is pressed the data goes to active sheet and sheet ("Izpisi") at the same time
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?
I have a situation with a spreadsheet i'm working on.
Basically, when a button is pressed I want it to search for all rows which have a "yes" in an offload column (Column AS, on the sheet "Active") (So it can be yes or no).
If it finds a yes, I need it to move the whole row in to a new sheet called "inactive", then move the remaining results up.
I have taken and played about with a different VBA code, but i'm not sure it's even the right line!
Here is what I have :
Sub Refresh() ByVal Target As Range) If Target.Column = 45 Then If UCase(Target.Value) = "Yes" Then Target.EntireRow.Copy Destination:=Sheets("Inactive"). _ Range("A" & Rows.Count).End(xlUp).Offset(1) Target.EntireRow.Delete End If End If End Sub
I have created a button name "Add Power Source" on excel sheet that adds a table and a button(named "Add Row") to the sheet.Whenever the user clicks the "add power source" button a table and a "Add new row " button is created .This "Add new row" button is used to add rows to the table. Now suppose the user has pressed the "add power source" button 5 times,so that there will be five table on sheet and each having a "add new row " button associated with it.When the user wants to add a new row to the table 2 say .How will I come to know in which table the rows are to be added using VBA.
I have a workbook with about 53 worksheets one for every week in the year. They are named as follows: VA-1-1-09 TO VA 12-28-09 All sheets are hidden except the (VA-1-1-09)
What I am trying to do is create some logic that would keep all 52 sheets Very hidden except sheet VA-1-1-09 Till the second week starts at that time what I would like to see happen sheet VA-1-5-09 come out of very hidden and appear visible and send sheet VA-1-1-09 to just a hidden state. I like to have this happen for every week of the year? If this can happen automatically that would be great however a command button clicked once a week would do the trick as well.
I tried to modify the above code, so it will refer undefined/dynamic data column, but getting an error during execution "Run Time Error - 424:" "Object required"
Sub AddFormsButton() Dim sShape As Shape With Range("J1") Set sShape = Sheets("Exposure Country").Shapes.AddFormControl _ (Type:=xlButtonControl, Left:=.Left, Top:=.Top, Width:=96, Height:=20) End With
[Code]...
Which is called within another macro and inserts a button onto sheet Exposure Country, after which the macro it was called from then stops (i.e. End Sub)
What I would like is that when the user clicks on this button it selects another sheet but I'm not sure how to achieve this.
I have 2 tabs on my spreadsheet. The first has some text at the top in cells A1 and A2, and that's it. The second tab I need a script for. Basically, I need some sort of macro button and a text box. I want people to be able to type some text in a cell or box on the 2nd tab, hit a button, and the text that has just been typed will be copied and pasted in to the next available cell down on the first tab.
For example, say the 1st tab had 'title' written in cell A1, and 'hello' written in cell A2. If I were to go to the 2nd tab, type 'bonjour' in to a cell or text box, and hit a button, the text 'bonjour' would be copied, the script would read the 1st tab and see that cells A1 and A2 already had text in them, and so paste 'bonjour' in to cell A3.
All, I am trying to generate a print button that prints a specific range without using macros. Is it possible? Currently I am using Follow Hyperlink Sheet Event to print the desired range, this works fine but I want to completely lose the macros in spread sheet.
I am trying to make this code works by Toggle botten in Mymenu.
when i press the toggle bottun the copy takes place, then move the curser to distenation and press the Toggle again to past only the comment.
How to make the Toggle bottun inside Mymenu (A menu in the Worsheet Menu Bar).
Sub Macro1() ' Selection.Copy Selection.PasteSpecial Paste:=xlPasteComments, Operation:=xlNone, _ SkipBlanks:=False, Transpose:=False Application.CutCopyMode = False End Sub
Is there a VBA code that will enable me to create a button and assign a certain macro to it everytime I insert a new worksheet?
how to insert a new worksheet with VBA, what I want is that when I insert that worksheet, there is already a button there with a specific macro(already made) assigned to it.
I'm trying to get a macro to run in my worksheet anytime someone presses the Enter key. I've been trying to use Private Sub Worksheet_Change(ByVal Target As Range) and getting extremely frustrated. I’ve tried a bunch of things and nothing seems to work. This is my latest that doesn’t work.
I have Sheet2 containing Supplier data in 2 columns - SupplierTAxCode and SupplierName (unsorted)
Sheet1 contains the Expenses section.
In Sheet1, column E6 to E1000, after inputting each SupplierTAxCode and pressing the RIGHT ARROW key, I would like to automatically get the SupplierName in column F6 to F1000 - from the corresponding data in Sheet2
In the event that the input in any of the cells in E6 to E1000 does not exist in SupplierTAxCode in Sheet2, would it be possible at the same time, to change the background color of the adjacent cell (SupplierName) in column F6 to F1000 at the same time - as a reminder to add those to the Supplier data in Sheet2 at a later date.
I could use Index Match and Conditional Formatting, but am concerned about the file sizes.
I have a row that contains each date for the year in B5:NB5. I would like to have a button or macro that will jump to the cell containing today's date.
I need to be able to run a macro called "Daily_Fuel_Line_Save2" when the enter key is pressed in any cell in the range A10:F10, but I still need to be able to use the tab key between the individual cells and change values in this range before starting the macro.
I already have the following code on the sheet which I would also like to keep.
how to make a code so that it captures the event of pressing any key of the keyboard and triggers a macro.
I tried using OnKey method but the problem with this is I am getting stick to any particular button whichever i specify in the onkey method wheareas I want to keep it general for any button in the keyboard.
Also if anyone can suggest how can I use OnKey method to use the "S" key to launch a macro.
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
Trying to create an N1.85 graph in Excel that has irregular spaced tick marks on the X-axis. Found the following information but no luck with it. Need US measure for this semi-log (10 X N1.85) graph. Also called a semi-expo (Q1.85) graph.
The resulting graph appears to be a log graph in reverse with one scale; the column widths are smaller at the left and become larger as they progress to the right.
Info found:
A 1.85 graph can be constructed manually by establishing a series of 15 values (in the case of the example in D5.2.1) from a base measurement to the exponent of 1.85.
Step 1 Select a base measurement for the desired size of the graph. A base measurement of 1.0 mm will produce a graph to 15 which is approximately 150 mm wide; a base measurement of 1.5 mm will produce a graph approximately 300 mm wide. In the case of a 1 mm base measurement, the x-axis numbers will be the 1-15 series. In the case of a base of 1.5 mm, the numbers will be represented by the series: 1.5, 3.0, 4.5, 6.0 etc. for 15 values.
Step 2 Construct a series of columns to the 1.85 exponent values measured from the zero point. The rows representing the pressure values are linear.
NOTE - A good approximation of the above can be computer-generated by a spreadsheet programme by entering a column width established from the exponential figures by subtracting the preceding value in each case. The column dimensions are displayed in the number of standard characters able to be accommodated in the column width which is slightly inaccurate in linear dimension.
The figures below indicate the values for a graph based on 1.0 mm.
Linear scale Exponential value of linear values = Column width = linear values to 1.85 power exponential value - preceding value