1. B

    Workbook.Open silently fails to function, execution continues - Totally baffled

    I am working on an Excel workbook (CollectorWorkbook) that is to open a series of about 5000 workbooks (DataWorkbooks) and collect data from specific cells in those DataWorkbooks. To do this, I want to use a UDF in about 30 cells of the CollectorWorkbook. I have used a similar approach to...
  2. R

    VBA - how to stop Excel from recalculating UDF's multiple times when used in namedrange/chart

    Hi, I have a serious problem, which I cannot solve for quite a while. I have three UDF's: Private Function IsInArray(stringToBeFound As Variant, arr As Variant) As Boolean IsInArray = Not IsError(Application.Match(stringToBeFound, arr, 0)) End Function This function checks...
  3. M

    Last Modified UDF Row Function

    I do not know if this is possible however, what I am looking for is to modify this UDF function to show the date that a cell was last modified. Currently, it is only showing the date that the UDF is inserted, not the actual date that the cell was modified. For Example: -If I am insert the...
  4. K

    Returning Jagged Arrays

    I've got a VBA UDF which extracts (multiple) numbers from a string, cell, range, or array. It's used in a variety of scenarios so it needs that flexibility, and generally worked EXCEPT...when the range has different result sizes in different cells The function returns a single number, array of...
  5. C

    Trim, Clean using Evaluate running into 256 character limit

    Hello I have large datasets that I run automated processes on that I need to trim and clean and have been using: Function CleanSheets(arrShtNames As Variant, startRow As Long) Dim ws As Worksheet Dim rng As Range Dim LR As Long, Lc As Long For Each ws In Worksheets(arrShtNames) With ws...
  6. J

    Reference Libraries Disappear at Startup

    I have to enable the following reference library to execute SQL commands in VBA. While I have added my UDF into my startup workbook, the reference library becomes unchecked every time I open and close Excel? How do I get it to stay added whenever I open my startup workbook? Libary: Microsoft...
  7. Saher Naji

    Could we make an excel formula shorter with use UDF function?

    I have this formula in excel, which is very long: and this is the BVA code, which is generated once I record a macro: Sub tESTpRICE() ' ' tESTpRICE Macro ' ' Range("AB2").Select ActiveCell.FormulaR1C1 = _ "=IF(RC[-26]=1,RC[-1],IF(RC[-26]=2,RC[-1]+R[1]C[-1],IF(RC[-26]=3...
  8. VBE313

    How Do you Put Optional Parameters in UDF the Correct Way?

    In the following code, I can not seem to calculate my UDF correctly, am I putting the optional things incorrectly? Function weldMinutes(numOfPIA, simpleOrComplex, antiSplatterYorN, fixtureYorN, numOfTack, weldType1, GMAWorGTAW1, weldLength1, numOfWeldStarts1, Optional weldType2 As Long...
  9. Dave_O

    VBA: Excel Uppercase words between HTML <strong>

    Hello, I am saving a website's source code as a text file, then importing it into a worksheet. I currently use a UDF to vbCrLf existing Uppercase word's, but I would like to make all words Uppercase between <strong> .....<\/strong> I am OK with either VBA or UDF. SAMPLE: As is...
  10. R

    Replicate SUMPRODUCT in VBA to create UDF which is much shorter to simplify appearance of formulae

    Hello, I would like to know how to create a UDF in VBA that replicates a SUMPRODUCT formula. Is this possible and how can I do it? I am new to VBA so not familiar enough with the code to create this myself. For example - UDF - HO() = SUMPRODUCT((Item Index range=X)*(Date Index...
  11. J

    Creating a UDF to execute a formula

    I am trying to create a UDF that executes the following formula but I am unsure how exactly to structure the code for UDFs, more up to speed on run-of-the-way VBA macros. Any guidance would be appreciated...
  12. JenniferMurphy

    Best way to skip 1st & last cell in range in UDF?

    I have a little UDF that does some tallies on a column of cells (B2:B5). <tbody> R/C A B 1 Group Rating 2 North 25.2 3 South 14.7 4 East 52.0 5 West 33.8 6 Average 31.4 </tbody> I call the UDF from another cell like this: =Tally(B2:B5) I want to change that to include the cell...
  13. VBE313

    UDF involving Split function or Formula Text?

    I created a UDF that calculates how many minutes it takes to complete a certain task. (ex: =MinutesToComplete(1,0.18,10,50,20) ) Is there a way to extract each argument/parameter? (ex: =RightParameter() ) and the answer would be 20
  14. VBE313

    Udf vlookup

    I have a table of items that are assigned a fixed cost. Example: Item) Name) Price 1) Red Ruby Shirt) $35.22 2) Blue Tuxedo) $47.90 On a separate sheet I have a UserForm with a list box that grabs the table from the other sheet. I would like...
  15. JenniferMurphy

    UDF stops running if I hot-key to another task

    I have a UDF that does some iterative calculations. It can take anywhere from about 2 to 8-10 seconds to complete its work. The data, which I enter into an InputBox, comes from another application. If I hot-key over to the other application, the UDF stops running until I hot-key back. Is there...
  16. VBE313

    adding error handling to UDF

    How can i better write this code and add error handling? Function TotalStainless(EasyorHard As Double, Thickness As Double, NumOfPierces As Double, HoleCutLength As Double, TotalPerimeter As Double) Dim PierceSecs As Double Dim HolesInchPerMin As Double Dim PerimInchPerMin As Double...
  17. M

    Make UDF based on multiple Match-criteria

    Has this formula made of Index and Match: =INDEX(Range,Match(1, (C:C=criteria1)*(D:D=criteria2)*(B:B=criteria3),0),5) The '5' represents the column number in Range that holds the cell with the value that should return as result of the formula. Basically the data table has 5 columns; #1 not...
  18. VBE313

    How can i replace this "a" without application ran code?

    How can i replace the bold part? Function test1234() Dim a As Long If ActiveSheet.Name = "Sheet1" Then Else End If a = Application.Caller.Row + 1 Do While Cells(a, 1).Value <> "Yes" If Cells(a, 2) = "Yes" Then Exit Do test1234 = test1234 + Val(Cells(a, 2).Value)...
  19. VBE313

    What does this mean on Microsoft’s website?

    Can someone please give me a detailed example of what this means? Do not use forward referencing and backward referencing To increase clarity and avoid errors, design your formulas so that they do not refer forward (to the right or below) to other formulas or cells. Forward referencing usually...
  20. VBE313

    UDF Loop Freezes Unless Calculating in The Sheet it’s in

    I have multiple UDFSs that loop through cells, I have application.volatile on them with worksheet change events that calculate the sheet. But if I am in a different sheet and press calculate, it freezes. Any suggestions?

Some videos you may like

This Week's Hot Topics