Can anyone explain or provide Excel VBA syntax for the following steps?
Assign a variable that equals the user's file's full folderpath. (e.g. variable equal to C:\Documents and Settings\ab123c\My Documents\BTemplate.xls)
Assign that folder path to a form button's macro. For example, the following macro would be assigned to a form button: 'C:\Documents and Settings\ab123c\My Documents\BTemplate.xls'!GetReqTemplate
A macro associated with a Fom button creates an email out of an excel chart and two excel sheets (as email body). It contains autofit and columwidth commands and leaves no spaces in the excel tables inserted in the email body. However, the same code when copied & pasted under an activeX control ComamndButton1, returns tall rows containing spaces in each row?!?
I should think that there is something envronmental that is causing it. Could some one please comment on the cause and the remedy?
Thanks & Regards,
anwer
Has anyone created a macro to create a forms button, assign a macro and name the button? Any info would be appreciated.
I made a form based on the "Course Booking Form" example, I think all the code is ok but when I try to make a button to open the form it just gives me the following error.
Runtime Error: 424
Object Required
On the following yellow line
Code:
Sub OpenCourseBookingForm()
frmCourseBooking.Show
End Sub
Attachment 68306
Hi everyone,
I want to create a form by pressing a button.I want to maka a maco to do that so can anyone tell me how to do that.
I have a button wich will add data entered on a form to a spreadsheet if the data meets certain criteria. If it does not it will not let you add anything.
I would like to add a second button that will add the data even if it does not meet the criteria but I need the second button to only be enabled with a password. Maybe a macro to change the button properties from locked to unlocked (true to false).
Is this possible?
Hi, I have a workbook that runs some macros using form control buttons. I have just moved the macros into an add-in file (.xlam) and installed the add-in. Now I want to assign the add-in macros to the form control buttons but they do not appear in the list of available macros. What do I need to do?
Thanks for your help.
So I'm looking to have a form popup based on selection of a macro button, but I don't see anywhere to create forms on excel, I also have no idea how to reference one if I did. The form needs it's own set of macro buttons.
Is this possible to do in excel, and if so, how would I go about creating the form?
Hi;
I have simply recorded a macro using "solver". I have set objective cell, variables and constraints.
Then I created a "form control button" in my active sheet and have assigned this macro to this button.
When i run the macro via this button, at each run it doubles the constraints in solver. I see it when I am checking the solver set after each run. After several runs, macro returns me with error:
The problems is too large for Solver to handle
Solver is limited to 200 variable cells and 100 constraints, plus bounds on the variable cells.
How can I prevent macro to increase the number of constraints in solver ?
The second problem is that, each time when I run macro with form control button, excel opens a Solver Result message window after solution.
How to prevent it ?
Thanks for answers.
Hi. I a newby to the whole Macro world and could really do with some help. Here is my problem; I have two macros that work separately on two different buttons (forms), one clears all content (text) in unlocked cells and the other clears any ticks in a check box. I need to the two to work at the same time from one click of a button (form) here are the two macros independently, the first one is to clear the range of cells :
Code:
Sub Button184_Click()
'
' Button184_Click Macro
'Dim c As Range
For Each c In Sheets("sheet1").UsedRange
If c.Locked = False Then
c.Value = ""
End If
Next
End Sub '
the next one is:
Code:
Sub ResetAllCheckboxes()
With ActiveSheet
For Each chk In .CheckBoxes
chk.Value = False
Next
End With
End Sub
This one clears all ticks in check boxes. I have tried to add the two macro's together but I get a compile error on the "For Each c In Sheets("sheet1").UsedRange"
Not sure if you need to know but, the data on the sheet is for an order form for equipment, this includes names, address, products ect and a number of different check boxes to be ticked.
As a user finishes the order, I want to be able for them to clear all data input so they can start a fresh order without having to delete individual cells or untick the boxes.
Pleeeeeease, can someone help me, it's been driving me mad!
Thanks in advance.
Matt