For multiple userforms, to call a procedure for the first time within each userform, I would prefer not to redeclare the procedure in those userforms. What ways can I avoid this?
Hello guys, i have a problem in my procedure, everything that happens before trying to execute the procedure is read by the program,
but when we call the procedure it doesn't just work in the specific form, can someone help me?
This codes works:
Private Sub bt_calculate_Click()...
When I make a selection using the drop down arrow, the change event executes once. However, if I type 1 character, the change event execute twice. I step through the procedure and I can see the code only execute once until to the end of the procedure and then my cursor changes to a wait circle...
Can someone help me please.
I am trying map out my hard drive – which files are in which folder, folder sizes etc.. This requires that I access folders.
The problem is that if the folder attribute is not normal i.e. folder.attribute is not =0 then when the procedure runs I get: Run-time error...
I need a procedure to save a document as pdf. The default file name needs to be the value that is entered in cell G7 + value entered in H5 as one word.
Could someone help me with this please?
Hi - I have a general questions about whether it's best to put all your code into 1 macro, or create separate modules for each procedure and then call them? thanks!
Hi,
I want to create a procedure where I will pass a userform object and that procedure will give me the all controls name and type related to that form, I have created below procedure but it is not working.
When I run procedure "Test2", in the line "Set myForm = FundInfoForm" it is firing the...
In Tab 1 i have a list of individual 5-digit codes. Each code is a specific type of hospital procedure. In tab 2 I have a list of hospital procedures names and the ranges of 5-digit codes that fall into that procedure. The ranges are NOT continuous and have gaps in them. For example, one...
I have tried to call my procedures to copy lines and clear cells that work if I run them individually but if I try and click on my red button, "Copy to relevant sheet and clear lines" on the Costing_tool sheet, one of the procedure names is highlighted and the error message reads: Expected...
Hi.
I have created a macro to which works as below
First part
one procedure refers a CSV file, create mails based on the row input & saves them in draft folder.
this is important because I want to review mails before sending them / i may decide not to send / send later....
Second part
other...
I wrote a function to return True if a cell range contains duplicate values.
Function Range_Contains_Duplicate_Values(Rng As Range) As Boolean
'-------------------------------------------------------------------------------
' NAME
' Range_Contains_Duplicate_Values(Rng As Range) As Boolean
'...
If Function A is called from an Excel cell and then calls Sub B, is there any way that B can return an error condition directly back to the Excel cell on behalf of A without returning control to A?
I am working on a UDF (A) that does a lot of error checking. Wanting to standardize the error...
I created a worksheet that contains many unique formulas in each cell.
The user is allowed to overwrite and/or modify the formulas in each cell, but double-clicking on the cell will always reinsert the original formula into the cell. The original formulas are contained within the VBA Objects...
After cobbling some code together, I stumbled upon this code that works well to Delete a procedure in a different module than the active one. Private Sub CommandButton1_Click() Sub DeleteProcedureFromModule()
Dim VBProj As VBIDE.VBProject
Dim VBComp As VBIDE.VBComponent...
I keep getting it to work in little chunks. As soon as I try to make it loop, I get errors.
Assumptions:
1 workbook
Varying # of sheets
Varying # of charts on some (but not all) sheets
Some, but not all, charts are column bar charts
Goal:
Procedure that goes through all the charts, on all the...
I use this procedure to add values to wsR from wsMembers
I’ve depleted my brain attempting to incorporate formatting of those values If conditions exist…
I’m not sure if my references are correct, but something like:
If wsMembers.Range C2.Offset(, 16).Value =< 4 Then
wsR.Range A3.Font.Italic =...
Hi,
I am looking at a document register system on Excel.
I'd like sheet 1 to be the Index sheet.
The Index sheet will look up the master "All forms and revisions list" and list all the forms with "Doc Ref numbers" beginning with "MF" and the most recent revision only.
The master sheet with all...
Looking at this:
https://www.mrexcel.com/forum/excel-questions/573357-prevent-vba-editor-being-opened.html
in particular this code:
CBTProc = CallNextHookEx _
(lCBTHook, idHook, ByVal wParam, ByVal lParam)
What is the significance of adding ByVal?
My understanding...
Hi,
What procedure will I use with object as worksheet so that when I select the word "TOTAL (OBS)", The code below will work?
If Sheets("CHIT1&2").Range("J12").Value = 2 Then
Set ht = Sheets("Tank 2")
u = ht.Range("A" & Rows.Count).End(xlUp).Row + 1
ht.Range("A" &...
Hi
I am designing a calendar with 365 command button as 365 days, and all buttons has same codes in spite of indexes.
Is there any way to have one procedure instead of 365. for example my first day on seventh month procedure is here:
Private Sub day_7_1_Click()
For i = 1 To Sheets.Count
If...
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.