procedure

  1. 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...
  2. 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...
  3. 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?
  4. 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!
  5. 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...
  6. 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...
  7. 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...
  8. 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...
  9. 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 '...
  10. 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...
  11. 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...
  12. 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...
  13. 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...
  14. 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 =...
  15. 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...
  16. T

    Passing argument via the calling procedure

    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...
  17. 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" &...
  18. 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...
  19. U

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

    Writing a formula using letters

    Hello all! I have a spreadsheet that I entered a check mark (letter "a" in Marlet font) into set boxes. I want to write a formula that tallies all those boxes containing an "a" check mark in a given row. How would I write it? Below is an example of the boxes- although it didn't copy right...

Some videos you may like

This Week's Hot Topics

Top