vba function

  1. E

    Public Declare PrtSafe Function Not Defined

    Hi, I'm trying to use this code to get the monitor resolution to resize a userform, but when I compile it, I get a GetSystemMetrics32 sub or function not defined. Option Explicit 'Function to get screen resolution Private Declare PtrSafe Function GetSystemMetrics32 Lib "user32" Alias...
  2. Z

    VBA: Call Dynamic Messages for InputBox Function

    Hello, Does anyone know if it's possible to use a dynamic message for an InputBox that is called on versus hard coded into the Procedure? I understand how to customize an InputBox; one of my examples here: getNum = InputBox("Enter number of rows to insert", _ "Insert Rows at end of...
  3. Z

    Prompt User for Number, then pass to another Sub procedure.

    Hello, I'm trying to figure out a way to prompt a user to input a number and to be able to use that input with a different sub procedure. My reasoning is that I want to reuse this User Prompt in different scenarios instead of baking it into several sub procedures. For example, I have a sub...
  4. S

    VBA user defined function: Find position of last number in cell

    Hi I have a cell (Let just say A1) which include both numbers and text. For example: 12x24Z I want a user defined function, which give me the position of the last number in that cell. In this case the position for number 4 (position = 5). I think I find a solution with the standard Excel...
  5. D

    Use VBA Function to calculate the rank

    I want to create a VBA function to calculate the rank, like that Function CALCULATERANKING(score As Double, list As Range) As Integer Dim row As Integer Dim column As Integer CalculateRanking = 1 For row = 1 To list.Rows.count If list.Cells(row, 1).Value > score Then...
  6. M

    Word Function returning Run Time Error '438 when called in Excel

    Hi Everyone I have been creating a macro in excel that will pull information from an excel sheet and insert into a word document. After much trial and error I have managed to get it to insert all the information I want but I am now stuck on changing the formatting of what is inserted. After...
  7. M

    vba function ThisCell.Address

    I have this function: Function student() student = Range("'" + Range("B1").Value + "student'!" + Application.ThisCell.Address).Value End Function I use this function in worksheet1. The value in B1 gives the name of another worksheet, let's say ws2. I need to pick up the value in that other...
  8. D

    Create VBA Function using existing Excel Functions

    <tbody> Reference Result of Formula Dog 1 Dog 1 Cat 2 Cat 2 Cat 2 Horse 1 Sheep 2 Sheep 2 </tbody> Hi, I’m hoping someone can help me with writing a VBA code to create a function that converts a formula I use to an easier function, using existing Excel...
  9. S

    Fuction for Quality Check

    Hello All, If some come can point me to right resources I would appreciate it. My problem is that I would like to create function =QC() that returns "Good" or "Bad". And I would use it to check all "code numbers" if they have less then 6 character to return text "Bad" next to a cell. If...
  10. K

    Custom VBA what-if scenario function?

    Hi, I need a non-invasive custom VBA "what-if" scenario function as follows: WHATIF(Output_Cell, Cell1, Value1, Cell2, Value2, ...) This would give the hypothetical value of the output cell if each of the given input Cells 1 to X were changed to the respective scenario values 1 to X, but...
  11. K

    Custom VBA solver/goalseek function?

    Hi, I need a non-invasive custom VBA solver/goalseek function as follows: SOLVE(Output_Cell, Target_Value, Input_Cell) This would give the hypothetical value of the input cell that would give the target value in the output cell, but without actually changing the value in the input cell. It...
  12. K

    Function or Formula to return date last modified?

    Hello, I am wondering if there is a simple Excel Worksheet Function (or less ideally, a custom VBA-defined Function) which can automatically return the date last modified, i.e., when the document was last updated/modified, recalculated and/or saved? Thanks for any tips. K.
  13. B

    Adding intellisense to VBA functions

    Hi there, Is there any way of adding intellisense to my VBA functions ? Some of the functions I write have quite a few parameters to them, and it'd be nice to be prompted about which parameters need to be passed to the function which order. As it stands, I'm constantly having to refer...
  14. 3PlankWalker

    Multiple Output from a Function giving zero

    I have writen this code to give Multiple Output from a Function but its All the Values as zero, Sub Trial()Dim X As Double, Y As Double Dim LlByL As Double, BbByB As Double Dim Trail1 As Double For X = 0.1 To 1 Step 0.1 For Y = 0.1 To 1 Step 0.1 Trial1 = Case2(X, Y, LlByL, BbByB)...
  15. J

    MINIFS VBA Function

    {=MIN(IF(($B$2:$B$65536="A")*($C$2:$C$65536=1),$A3:$A65336))} I currently have the above function on an excel sheet, I was wondering if anyone had a function to calculate the MIN via VBA instead? For all intents and purposes the sheet i'm looping through looks like: Date Str1...
  16. C

    Function not reliably feeding data back?

    I apologize for posting this again. This is an update of an issue I posted yesterday. I forgot to add a tag to that post and Could not see how to update it. Hope someone can help with this...it is beyond bizzare. I watched this several times now. n = the number of columns of data. When n=4...
  17. M

    NumName: Excel VBA Function to Convert Huge Long Numbers into their Numeric Word Names in a Text String Format

    I made an Excel function that converts a large string of numbers into their numeric word names. I am offering it to the community as free public domain. It has many parameters to control the desired output. You can choose USA or European names with a simple parameter change. English names are...
  18. O

    Help! my VBA function doesnt result right

    Hi, I have searched the net for a solution but found non. My goal is to write a function that I can use anywhere in a work book. The function gets a project number (integer) & returns the last Bill number of the project as a string. this will save me using the DB functions (they are not...
  19. A

    VBA Function Help Requied - Real Estate Problem

    I am trying to define some calculations for various rental review profiles in a real estate cashflow. The problems being that there are to many variables and as such I want to create functions in VBA to cater for them. Example 1: - Fixed% review with a cap, collar and ratchet (little...
  20. J

    VBA Function: check last modified date of files with wildcards in name and path

    VBA Newbie here. Please forgive any protocall mistakes: I currently use the following to test for files to exist after running a batch to copy them from various locations on a network. Works well allows wildcards in path, file name and extension. Private Function IsFileTrue(fDriveFolder...

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 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.
Go back
Back
Top