1. K

    Procedure doen´t result

    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()...
  2. A

    Combo box Change Event twice

    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...
  3. D

    Changing folder attributes - Run-time error ‘70’: permission denied

    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...
  4. D

    save as pdf

    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?
  5. H

    Module Usage

    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!
  6. K

    Excel VBA Fetch All Control Type And Name From A UserForm

    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...
  7. A

    How can I find the range in which is cell falls when the ranges are not continuous?

    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...
  8. D

    How do I make my command button work by calling procedures that work

    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...
  9. S

    Macro skips some of the emails when sent in large number (via VBA outlook)

    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...
  10. E

    User written VBA code to test for duplicate values produces unexpected output

    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 '...
  11. JenniferMurphy

    Can a subfunction return an error on behalf of the caller?

    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...
  12. D

    DoubleClick event- procedure too large. How to split it up?

    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...
  13. C

    Create procedure using VBA in a separate module

    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...
  14. A

    Procedure to add border around all data points, on all charts, on all sheets of a workbook?

    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...
  15. B

    Add Formatting to my procedure...or, Call another module?

    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 =...
  16. D

    Index sheet lookup recent entry on subsequent sheets

    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...
  17. T

    Passing argument via the calling procedure

    Looking at this: in particular this code: CBTProc = CallNextHookEx _ (lCBTHook, idHook, ByVal wParam, ByVal lParam) What is the significance of adding ByVal? My understanding...
  18. N

    Procedure for code

    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" &...
  19. A

    same codes for same command buttons procedures

    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...
  20. USFengBULLS

    Question on Events and Procedure - Workbook_Open

    Hello All, I am trying to have three cells filled on a particular sheet when a user opens the workbook every time. Here is the sub getting the values, which in in my module 1 Public Sub Project_Info() Dim P_Number As Range, P_Name As Range, GC As Range Set P_Number = Sheets("CO...

Watch MrExcel Video

This Week's Hot Topics

We've detected that you are using an adblocker.

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
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 "".
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.
Go back