How To Create UDFs

May 26, 2009

I know this is a mess - I am just learning how to create UDFs. I am trying to extract first and last name from an email address is this format - John.Smith@abc.com. This is what I have and of course it does not respond . .

View 9 Replies


ADVERTISEMENT

#NAME - Error On 2 UDFs But Not 3rd

Dec 24, 2007

I have 3 UDFs that I created as Excel addins. They are all loaded at run time,
but the first two return the #NAME? error when I try to use them... The third
(Age3) works fine...

Function Age(DoB As Date)
Age = Int((Date - DoB) / 365.25)
End Function

Function Age2(DoB As Date)
Age2 = Int((Date - DoB) / 365.25)
End Function

Function Age3(DoB As Date)
Age3 = Int((Date - DoB) / 365.25)
End Function

View 9 Replies View Related

UDFs To Other Users

Feb 27, 2009

Although I'm able to write UDFs and distribute addins, one thing I've found is that if you use a UDF formula on a sheet on one machine, save it, then open it on another, Excel doesn't automatically look in the local .xla for the formula. In fact it tries to find it on the network (expecting to locate the originating user's machine, I suspect) and then throw a strop....

View 9 Replies View Related

UDFs And Defined Names

Feb 9, 2009

I have a column J that is named Premium. If I use the function =INT(Premium) in K4 then it returns the integer for the value in J4. If I do the same thing with a UDF then the function argument receives all the values in column J. The author of the function says this is how UDFs work by design. Is there a way to use defined names with UDFs and have it work the way it does with built in functions?

View 5 Replies View Related

Assigning UDFs To Catergories

Jul 13, 2006

I have a addin that contains user defined functions. I am using the MacroOptions command to assign the functions to categories. The addin loads without any problem in Excel 2003. In Excel 2002 and Excel 2007 Beta, if I open Excel and load the addin using the menu the addin loads OK. But when I try to open Excel with the addin already installed I get the following error message: Run-time error '1004':
Method 'MacroOptions' of object'_Application' failed. how to aviod this error message in Excel 2002 and Excel 2007 Beta?

View 2 Replies View Related

Jumps To UDFs In Addin Module

Jan 20, 2013

When I Step through (Using the f8 Key) the below code -- Comments Explain my problem/Question

Code:

Sub SetUpTable()
Worksheets("Sheet1").Activate
Application.Calculation = xlCalculationManual ' Without entering this line the Macro in the next line or two), jumps to and begins running a UDF in a VBE ADDIN
'Module marked as Volitile
For TheYear = 1 To 5
Cells(1, TheYear + 1).Value = 1990 + TheYear

[Code]....

View 9 Replies View Related

Excel 2010 :: Registering Add-in With UDFs

May 14, 2014

Windows 7, Excel 2010

I have an add-in with UDFs. I want explanation of the function arguments in the function wizard and also be able to click for Help in the wizard. So I register the functions like this:

Application.MacroOptions macro:=Range("afsfunctienaam")(i), _
Description:=Range("afsfunctiebeschrijving")(i), _
Category:=Range("afsfunctiecategorie")(i), _
HelpContextID:=Range("afshelpcontextid")(i), _
HelpFile:=HelpPad, _
argumentdescriptions:=Sheets("afsnederlands").Range(Paramtabel)

Where Param is the address of an array with argument descriptions, as text (like "A1:A4").

If I run the xlsm file, it works fine.

But if I load the xlam file in the add-ins dialog, the path to the Help file seems to be lost; I get directed to Excel's general online Help. The explanation of the arguments still work. Probably because they are already in the registry. But shouldn't the Help path be held in the registry as well?

View 1 Replies View Related

UDFs Recalculating And Changing Cells

Aug 18, 2009

I have been asked to look at moving a very large set of pricing sheets from Excel 2000 to Excel 2003. In the progress of this I have found that the functionality for a UDF in a cell to change/recalculate any other cells has been removed in Excel XP, whereas it was available in Excel 2000. The amount of work required to refactor the code is very large, and before starting on it it would be good to find out if there is a workaround.

The Sheet works in the following way:-User enters values, clicks a button to run a Macro,-Macro calculates all the ranges required to return a price-In many of the cells it is calculating are Functions which go and look at a large number of cells to calculate the price, sometimes writing to other Cells and sometimes having to recalculate other cells-As it is such a large sheet we can't simply calculate all cells before we tell it to price, as they are not all needed and so aren't calculated unless needed for performance reasons.It would be a lot of work to move the functionality from the Functions to the initial macro call, though this would solve the problem. Is there any other workaround?Macro security is set to low.The Errors I receive are the following:The UDF will hit a line like Range("DataRange").Calculate and this will raise a "Calculate method of Range class Failed" error. If it hits a line like Range("DataRange").Value = 1 this will raise a "Application-defined or object-defined error"If it hits a line like ActiveWorkbook.Names.Add Name:="This_Name", RefersToR1C1:="=Sheet1!R8C2" then it also raise a "Application-defined or object-defined error".Any of these run from a UDF in Excel 2000 works.I have a sample workbook if this isn't clear

View 9 Replies View Related

Create Macro That Can Create Dynamic Copy / Paste Loop?

Feb 12, 2014

I need to create a macro that can create a dynamic copy/paste loop. So far what I have is horribly inefficient. Each row in colmn A(minus the header) has a unique number in it. For each unique number, I need to paste it based on the number of column headers in row 1(minus column A). So, if there are 20 column headers, I need to copy cell A2 and paste it 19 times in another sheet. Then, I need to move to the next number in column A and do the same thing. Here's what I have:

[Code] .........

You can see that this is not dynamic. If I add another row to my table and rerun the macro, it will not catch it. I've attached a sample file to show you the big picture of what I'm trying to do. The data that I have is in Sheet1, and I'm trying to get it into the format in Sheet3. Rows/columns will be periodically added to the table in Sheet1, so the macro needs to be dynamic to catch that. The data in Sheet3 will always remain, and the macro will add the updated data below the old data in Sheet3.

FC_Macro_Sample.xlsm

View 8 Replies View Related

Need To Create A Button That Can Copy Cells, Create A New Sheet And Then Paste There

Jan 14, 2009

So I've got Sheet 1 with say

____A___B___C
1___m___i___c
2___r___o___s
3___o___f___t

I would like to create a button that can create a new sheet and paste A1 to C3 at the same location on the new sheet

and I need this to create a new sheet and do that everytime the button is pressed.....

View 11 Replies View Related

Create A Chart To Create Totals Based Upon Different Keys

Aug 7, 2006

Trying to create an excel chart to create totals based upon different keys. I
need to be able to calculate how many customers there are by Manager and then
By Rep. Then to figure out how many were New, Current, Total # of RSVP and
attended for that Rep. Below is how I have started but I am having some
problems getting certain parts. I know when I get one the rest will fall into
place. I can calculate how many total customers by manager and by rep just by
doing a Countif command but how do I determine the # of New, Current etc. Is
there a If Than command? Managers Totals are simply his reps totals.

Example..
A B C D E
F G
1 Manager Rep Customer New Biz Current # RSVP # Actual Attend

Need totals to look something like this....

A B C D E
F G
1 # of Cust # New # Current #RSVP #
Actual Attend
2 Manager
3 Rep 1
4 Rep 2

View 15 Replies View Related

VBA Create New Tab And Name

May 7, 2014

I have a sheet with a list of suppliers, then under that, all the products we buy from them.

What I'd like is each time the word "Supplier" appears in column A, a new Tab is created with the value in column B as the title, then all the data under than copied until the word "Supplier" appears again.

[Code] .....

View 6 Replies View Related

Create Tag In VBA?

Apr 22, 2009

I found this really cool code that creates a tag cloud in Excel using VBA. It's far too complex for my understanding but I was hoping I could get some of the experts opinions on here about modification possibilities. I have attached the macro-enabled 2007 workbook. What I am trying to do is search through a list of keywords and determine each keyword's density within a list. The list for example could look like this:

slow windows xp
windows xp running slow
windows xp computer
[slow windows xp]
[windows xp running slow]
[windows xp computer]
[computer running slow windows xp]
"computer running slow windows xp"
"slow windows xp"
"windows xp running slow"
"windows xp computer"

You'll notice the characters " [ ] of which I would like to ignore when the cloud builds. The cloud would list the most dense keywords first, and gradually decrease to the least dense keywords. The macro code is inside the workbook but I'll list it here to:

View 2 Replies View Related

Need To Create 2 Columns From One

Apr 26, 2009

I have a spreadsheet in which I want to extract or create two different columsn one will have the name of the store and the other will have the SKU item number. the way it is right both are on same column. I have attached a sample.

View 9 Replies View Related

Create A File

May 20, 2009

Here I am Attachiching a MHTML file which has multilayer in the left panel. If You Open it in excel u can edit it and navigate through the layers. I want to know can I create an excel file like this one.

http://rapidshare.com/files/235065073/howto.MHTML.html
OR
http://www.2shared.com/file/5865199/84c1fea5/howto.html
(sorry excel forum is not accepting mhtml file for attachment)

View 5 Replies View Related

How To Create Signals For Top 20%?

Sep 18, 2009

As you can see from the chart or picture. I want to create a =IF function signal so that on the right column it will show which of the hours is the top 20%/top 5 hours

Is there anyway possible in excel to do this? To create a signal on the right showing which of the days hours, is the top 5 hours with the highest volumne?

View 13 Replies View Related

How To Create A File With 0 KB

May 2, 2013

How to create a excel file with 0 KB ? Because when the user creates a new excel file, it is created with 9 KB by default. But when creating a word file its created with 0 KB. Why its happening ? I want to test uploading a excel file with 0 KB..

View 1 Replies View Related

How To Create Search

Jun 11, 2013

I have a large table with data, and I would like to have a box at the top, and when some types the name of city, then all records that have the city will come up. how to do it.

View 3 Replies View Related

How To Create Userform

Mar 28, 2013

i want to create one user form like shown in this picture below. right side 3 options need to input form the user and clicking on the button get option chain, it gets the data from www and fills all the columns frm expiry to optn int..

View 2 Replies View Related

New To Macros - How Do I Create And Run One

May 18, 2007

I have an API that continuously gets stock price. The price appears in one cell at all times - let's call it A1

I want to record the value in a different cell every time it changes, so I can analyze the data.

so A1 = 15
B1 = 15

little later
A1 = 15.2
B2 = 15.2

I did some googling and came to a conclusion that I needed to write a macro.

I see that there is a function or event called Worksheet_Calculate()

Apparently it is supposed to do whatever when a value changes (per calculation)

How do I write a macro, and then execute it?

View 10 Replies View Related

Create Automatic Sum

Mar 10, 2008

supposing i have column A which is vehicle number
and column b is fuel quantity

how to make in c automatic sum by vehicle number as i may have many entried in column A

example

vehno1 20
vehno1 21
vehno2 25.5
vehno2 40
vehno3 50

View 11 Replies View Related

Create If Then Loop

Nov 18, 2008

I have an excel sheet that will have a column with out of sequence numbers. I need a script that will evaluate each row and insert a row and the missing sequence. Below is the code I have written but I keep getting a compile error saying Else without If.

View 4 Replies View Related

Create Textfile With VBA

May 12, 2009

I want make a VBA code which can create a .txt file in a folder and if that file already exists it doesn’t overwrite that file.

View 4 Replies View Related

Create A Two Way Formula

Jan 7, 2010

I want to be able to create formulas where the output can act as the input.

For example, I tried to write a simple proof of concept script where you can convert between pounds and kilograms. So if you type in a value for pounds, it'll update the kilograms cell. And if you type in a value for kilograms - it'll update the pounds cell.

This is what I came up with:

View 3 Replies View Related

How To Create N1.85 Graph

Sep 28, 2004

Trying to create an N1.85 graph in Excel that has irregular spaced tick marks on the X-axis. Found the following information but no luck with it. Need US measure for this semi-log (10 X N1.85) graph. Also called a semi-expo (Q1.85) graph.

The resulting graph appears to be a log graph in reverse with one scale; the column widths are smaller at the left and become larger as they progress to the right.

Info found:

A 1.85 graph can be constructed manually by establishing a series of 15 values (in the case of the example in D5.2.1) from a base measurement to the exponent of 1.85.

Step 1
Select a base measurement for the desired size of the graph. A base measurement of 1.0 mm will produce a graph to 15 which is approximately 150 mm wide; a base measurement of 1.5 mm will produce a graph approximately 300 mm wide. In the case of a 1 mm base measurement, the x-axis numbers will be the 1-15 series. In the case of a base of 1.5 mm, the numbers will be represented by the series: 1.5, 3.0, 4.5, 6.0 etc. for 15 values.

Step 2
Construct a series of columns to the 1.85 exponent values measured from the zero point. The rows representing the pressure values are linear.

NOTE - A good approximation of the above can be computer-generated by a spreadsheet programme by entering a column width established from the exponential figures by subtracting the preceding value in each case. The column dimensions are displayed in the number of standard characters able to be accommodated in the column width which is slightly inaccurate in linear dimension.

The figures below indicate the values for a graph based on 1.0 mm.

Linear scale Exponential value of linear values = Column width = linear values to 1.85 power exponential value - preceding value

1 1 1
2 3.61 2.61
3 7.63 4.03
4 13.00 5.36
5 19.64 6.64

[Code]....

View 6 Replies View Related

How To Create For / Next Loop Across Row

Jan 22, 2012

I'm sure this is easy but I'm trying to create a for...next loop that goes across the row. My final output will be basically be to see if the cell says Saturday or Sunday and offset by 2 rows and highlight the rest of the column.

Code:

Range("A1").Select
For X = 2 To Range(Activecell, Selection.End(xlRight)).Column
Range(2, X).Select
ActiveCell.Value = "Column"
Next X

That's what I came up with but it doesn't seem to be right.

View 3 Replies View Related

Create A Floating Tab?

Feb 23, 2012

if it is possible to create a floating Tab like you get on websites, so ehwn you move the spreadsheet to the left or right, the tab/shape with words in moves with you.

View 8 Replies View Related

Create Macro To Add 1 To The Value?

Jun 22, 2012

Create a macro that when ran will add 1 to the value of "Feeunits!AE1" In other words if the value is 10 then the macro will change the value to 11.

View 3 Replies View Related

How To Create Web Query

Dec 28, 2012

I need to create a web query.

I have lot of post codes which needs to be checked in a web page and the output column needs to be updated in the spreadsheet.

Link: - Find UK Postcodes Inside a Radius

for example: - The post code WD18 1TB will be there in Excel Sheet this has to be copied and pasted in the link in column

Step 2 : Click on map OR Place radius by location name or postcode

and Step 1 : Radius should be updated as 10 and then the Draw Radius needs to be clicked. Then the output needs to be copied (in this case the output is: AL2,HA1,HA2,HA3,HA4,HA5,HA6,HA7,HP3,UB9,WD1,WD17,WD18,WD19,WD2,WD23,WD24,WD25,WD3,WD4,WD5,WD6,WD7) in our spreadsheet in the next sheet.

View 1 Replies View Related

IF Function Which Will Create Y For 1 Or 2

Jan 5, 2013

In column A, I have numbers ranging from 0-6. In column B, I would like to create a "Y" each time there is a 1 or 2 in column A. How can I create an IF function which will create a Y for a 1 or 2?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved