Can't Assign Shortcut To Macro: 'Options...' Button Disabled
Feb 23, 2010
I'm trying to assign a shortcut to a macro I wrote in VB. However, when I go to Tools->Macros->Macros, none of my macros (whether coded in VB or recorded) have the "Options..." button enabled, so I can't assign the macro. This happens whether I use Excel 2003 or Excel 2007. The file is not readonly and I have tried the various levels of macro security. I have VBA installed.
View 5 Replies
ADVERTISEMENT
Jul 7, 2007
I have several macros where I have assigned keyboard shortcuts, as below. Yet they don't work.
Sub My_FastCleanup()
' My_FastCleanup Macro
' Keyboard Shortcut: Ctrl+Shift+M
-macro stuff-
End Sub
View 9 Replies
View Related
Mar 7, 2014
I have a workbook with macro button to run some vba, if i want the button to disable when the user make copies of the workbook (date created is later than original wb saved time) what codes to add in the VBA?
what i assume is to add the time to a cell when the wb is saved, when the wb opens, it check for that cell if the same with the date created, if different, then disable the macro button.
View 9 Replies
View Related
Apr 3, 2008
While practicing writing macros and studying the VBA code, I decided to add a button to run the macro, something I've done many times in the past. But the option to associate the new button with any macro doesn't seem to be available.
A. How can I assign a new button to a macro
and
B. How can I make the association in VBA?
View 9 Replies
View Related
Nov 22, 2005
I have to modify 2000 files so I've written a master file that loops through a list, importing modules and forms into the 2000 files it opens and closes. On each file when open it draws a button on worksheet. I then want to assign a macro to the button called "ModifyMenu" . The code for 'Modifymenu' is imported into file_01.xls and is a unique name. It does not exist is master.xls, so no confusion.
The code for assigning the code is as follows :
Windows("file_01.xls").Activate
ActiveSheet.Shapes("Button").Select
or
Workbooks("file_01.xls").Sheets("1 B").Shapes("Button").Select
Then
Selection.OnAction = "ModifyMenu"
(This links to master.xls!ModifyMenu not file_01.xls)
Selection.OnAction = "file_01.xls!ModifyMenu"
(This fails, runtime 1004. 'Unable to set the OnAction property of the button class)
Selection.OnAction = ThisWorkbook.Name & "!ModifyMenu"
(This links to master. MAster is the active code even though 'file_01.xls' is the active worksheet)
Variations on the above seem to result in the same 1004 error or linking back to master regardless of the fact I'm trying to link to file_01.xls.
View 6 Replies
View Related
Oct 22, 2009
I have a start page in the beginning of my excel workbook.
This is where i want to assign a macro to a search button.
I want the macro to search the entire workbook but only in a certain block on each worksheet.
View 9 Replies
View Related
Jul 17, 2009
have a pain constantly entering passwords to open workbooks, is it possible to assign passwords to a particular short cut so if for example if I hit CTRL J it will automatically enter the password jabgat2009 and open the workbook- no big deal just if someone know of the top of their head
View 9 Replies
View Related
Jun 9, 2013
I want to assign a macro of start time and end time on one button. I tried but its not working..
View 2 Replies
View Related
Dec 30, 2008
Created a button in a spreadsheet but cannot activate the shortcut menu that contains "assign macro." Help says select the button, right click on a handle and a shortcut menu appears with "assign macro." Not. I right clicked every handle numerous times and get the regular shortcut menu without the "assign macro" option.
View 9 Replies
View Related
Apr 2, 2008
how I can write code to create a button on a worksheets and then link to another subprocedure.
I tried recording a macro and this is what excel so eloquently gave me:
ActiveSheet.Buttons.Add(384.75, 60.75, 79.5, 39.75).Select
Selection.OnAction = "CreateImport"
ActiveSheet.Shapes("Button 1").Select
Selection.Characters.Text = "Parse Deposits for Import"
With Selection.Characters(Start:=1, Length:=25).Font
. Name = "Arial"
.FontStyle = "Regular"
.Size = 10
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
This works fine, my only problem is if the button that is created is actually named Button2 or 3, etc. Is there a way to assign the new button to a variable, or would it be an object? this way it wouldn't matter what it was named.
View 3 Replies
View Related
Aug 6, 2007
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.
View 3 Replies
View Related
Dec 23, 2009
I'm verrry new to editing VBA code and I've been trying to figure out how to send a column of data ("Min Data" AB3:AB21 from "Sheet1") to a worksheet ("F4" - Min) and sending another column of data ("Max Data" AC3:AC21 from "Sheet1") to a different worksheet ("F4" - Max) by using only the one button ("Record Data" from "Sheet1"
I've been trying to figure out ways to edit the VBA in "Module 1" to make this work
Can anyone help me out here? If what i'm asking for isn't clear enough, just let me know and i'll try to explain in more detail.
View 6 Replies
View Related
Jun 10, 2014
I do have a VBA that runs in the report. For whatever reason this stops excel back button (or CRTL Z) from working. What would i need to change in order for back button to work?
I know it is due to this VBA since all other spreadsheets are working fine and as soon as i open this spreadsheet undo button stops functioning.
Private Sub Worksheet_Calculate()
Dim MyPic As Picture
Me.Pictures.Visible = False
Pictures("Picture 11").Visible = True
With Range("AH1")
For Each MyPic In Me.Pictures
If MyPic.Name = .Text Then
[code].....
View 1 Replies
View Related
Mar 6, 2014
I am running excel 2010 with windows 7. I created a macro in sheet 1 and I wish to activate the macro from sheet 2 using a form button. I have entered the code below. I know how to perform this function on a more simple macro like adding names to cells. This code is a bit more complex I just dont know where to start.
Code:
Sub LoanData()
'
' LoanData Macro
[Code].....
View 3 Replies
View Related
Nov 24, 2009
When i have an excel sheet opened and hit ctrl +f the find replace window displays. I want to add a button on spreadsheet that when i click on it, the find and replace window appears, I can not figure out how to do this. I tried using .onkey
View 8 Replies
View Related
Sep 12, 2013
I have found instructions on the Net for stopping that rather intrusive 'Paste Options' pop-up button appearing in Excel 2003, 2007 and 2010 (I think; or it might have been 2011). But I have Excel 2008, and none of the instructions I have found applies. I cannot find a Microsoft Office button (other than the icon of the folder in Applications); nor is there 'Options' in the File menu. I use a Mac mini (Intel) with OS 10.8.4 (Mountain Lion).
View 2 Replies
View Related
May 10, 2014
How can I execute two macros with one button press?
the sub names are CDO_Text and CDO_Mail
View 2 Replies
View Related
Jul 3, 2014
I need to assign two actions to a one button.
1. action: Copy Column A, paste to Column C
2. Write time&date into G5
I am only capable of doing one button for each action using the macro recorder and simple code:
[Code] .....
View 2 Replies
View Related
Aug 26, 2007
I have had the following written for me
Private Sub Worksheet_Change(ByVal Target As Range)
For Each Cell In Target
If Cell.Column = 4 and Cell.row >= 17 and Cell.row <= 20 Then
If Cell <>"" Then
Cell.Offset(0, 3) = Date
Else
Cell.Offset(0, 3) = ""
End If
End If
Next Cell
End Sub
I wish to assign that code to a button on sheet 1.
I normally just right click the buitton and assign the macro, but on this occasion I can't. I think it's to do with it being a private sub.
View 14 Replies
View Related
Mar 7, 2013
I have a worksheet with several option buttons and until yesterday, I had no problem selecting them. But today, every time, I select a radio button, an error shows up stating "Cannot run Macro "Option Button_click. Macro is not available in this workbook or is disabled". When the user selects a radio button, text appears in Col B depending on what button was selected (using VLOOKUP). That stuff is still working fine. It's just as soon as I click a radio button, the error shows up.
Based on the radio button selected, user can add in information to the columns adjacent to it, and then click a button to store that information in some rows below. The code for that button is stored in the sheet module. I have tried enabling macros and disabling macros and no change has appeared. What I have noticed though is that yesterday, when i opened the workbook, a yellow bar appeared asking if I wanted to "Enable Content". Today, that bar didn't appear.
View 1 Replies
View Related
Aug 2, 2014
continued from: [URL]
Option Explicit forces explicit declaration of all variables in the code. That is why i had to declare ws as worksheet using the Dim statement before using it in the code. It is recommended to have it - however for this code it wouldn't have mattered.
I'm not sure I exactly follow what you imply here. But yes, you can hide all the sheets at first and then "unhide" at the start of the macro. Let's say you have a "Start" sheet.. then:
[Code] .....
The workbook is used by other people too. I cannot just tell them to hide the sheets, it defeats the purpose. What I want is, when macro is disabled, they will only see the START sheet, otherwise, all sheets will be visible. To add to this, a new sheet is added everyday. Sheets name are calendar dates in mmdd format
View 4 Replies
View Related
Sep 24, 2009
I was wondering if it is possible to prevent a macro from running depending on what value is in a specified cell.
I have a huge excel sheet and a commandbutton that runs a bunch of macros in order to generate a report.
I want to force the user to select a specific project before all the macros are run. Just making the report for a specific project only takes a few seconds but if no project is selected then it runs throught the whole database and it takes forever.
I have set up a cell that changes value depending on wether a project is selected or not. I have placed the cell in the -ForMacros- sheet. Now is it possible to write some code into the commandbutton that halts the report generation + displays a warning box telling the user to select a project first?
What values used to determine wether the macro runs or not doesnt matter to me. Whatever is easier for you
I have attached a sample workbook for you to work on.
View 6 Replies
View Related
Oct 23, 2006
I accidently put the Application.Quit command in the wrong place. Now Excel closes immediately when the macro executes. I can get into Excel if I disable the macro, but then it won't let me edit the macro. Is there a way to edit my macro without executing it?
View 7 Replies
View Related
Jun 8, 2006
I am creating controls on a Userform on the fly. A shortened example of my code to create a button is below:
Set BtnEdit = .Controls.Add("Forms.CommandButton.1", "BtnEdit", True)
With BtnEdit
.Left = 220
.Top = 85
.Width = 50
.Font.Underline = True
.Caption = "Edit"
.Enabled = True
End With
What I want to do is assign a pre-existing sub-routine to the button, at the same time as I create it. I have tried using
.OnAction = Mysubroutine
View 4 Replies
View Related
Dec 23, 2013
Userform2 is popped up from another userform3.
How can I have userform 3 when clicked fill in a textbox on userform2 and then finally assign it to cell F3 on my worksheet.
VB:
Private Sub CommandButton2_Click()End Sub
So I need commandbutton2 (which needs to retain a value of 1` when clicked ) on Userform3 to assign the value of 1 to TextBox44 (Which is using control Source F3 so the value here ends up in F3
VB:
Private Sub TextBox44_Change()
If TextBox44 > 5 Then
MsgBox "Your entry must be part between 1 and 5", vbCritical
Exit Sub
End If
End Sub
View 2 Replies
View Related
Feb 13, 2014
Sheet 2 contains a drop down list containing names, would like to assign a Macro to a button on same sheet that would refer to sheet 3 based on certain criteria.
Sheet 3 contains columns A - K of data. 2 criteria, data in column D and column K. Column D would be the same as names in the drop down list, whereas column K refers to a constant, either y or n.
Example: If D contains "Cheddar" and K contains "Y", copy and paste A:K to Sheet1, preferably starting at row 7.
View 3 Replies
View Related
Aug 17, 2006
When you enable macros the sheets 2, 3, 4 ect are visible but if you disable macros, you only see sheet 1 and and you can place a message on the sheet saying this will only work with macros enabled.
View 2 Replies
View Related
Feb 10, 2010
The following macro works when I run using Alt+F8+Enter
The macro also works when it is linked to a button on the worksheet.
However, it does not work when I try to use the keyboard shortcut Ctrl+Shift+P.
I've tried adding the shortcut key code into the macro -- still doesn't work.
I've tried changing the shortcut key to a different letter
View 8 Replies
View Related
Dec 10, 2013
I have a macro stored a module at Personel workbook and i am using personel workbook as a hidden one. when i assign a shortcut below macro it is not working but whrn i am press F5 at VBA Editor it is working.
Here is the code:
Code:
Sub Transferdata()
On Error GoTo err1:
Application.DisplayAlerts = False
[Code]....
View 7 Replies
View Related
Feb 9, 2007
I am unable to create a macro and later go back and assign a shortcut key and run the macro.
View 9 Replies
View Related