ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   user defined function (https://www.excelbanter.com/excel-worksheet-functions/137906-user-defined-function.html)

UB

user defined function
 
I have written a function in module1 ,
whenever I do change change in the code of the fuction and try to run, it
gives me a message to create a macro.
Please advise where I am going wrong.
Thanks

Dave F

user defined function
 
Couldn't tell you without seeing the code. Post it.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"ub" wrote:

I have written a function in module1 ,
whenever I do change change in the code of the fuction and try to run, it
gives me a message to create a macro.
Please advise where I am going wrong.
Thanks


UB

user defined function
 
Here's the function
Function sumvisible(rng As Range)


Application.Volatile


Dim myTotal As Double
Dim myCell As Range

Application.Volatile

myTotal = 0
For Each myCell In rng.Cells
If Application.IsNumber(myCell.Value) Then
If myCell.EntireRow.Hidden = False _
And myCell.EntireColumn.Hidden = False Then
myTotal = myTotal + myCell.Value
End If
End If
Next myCell


sumvisible = myTotal


End Function


"Dave F" wrote:

Couldn't tell you without seeing the code. Post it.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"ub" wrote:

I have written a function in module1 ,
whenever I do change change in the code of the fuction and try to run, it
gives me a message to create a macro.
Please advise where I am going wrong.
Thanks


Dave F

user defined function
 
I just ran this UDF with no problem.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"ub" wrote:

Here's the function
Function sumvisible(rng As Range)


Application.Volatile


Dim myTotal As Double
Dim myCell As Range

Application.Volatile

myTotal = 0
For Each myCell In rng.Cells
If Application.IsNumber(myCell.Value) Then
If myCell.EntireRow.Hidden = False _
And myCell.EntireColumn.Hidden = False Then
myTotal = myTotal + myCell.Value
End If
End If
Next myCell


sumvisible = myTotal


End Function


"Dave F" wrote:

Couldn't tell you without seeing the code. Post it.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"ub" wrote:

I have written a function in module1 ,
whenever I do change change in the code of the fuction and try to run, it
gives me a message to create a macro.
Please advise where I am going wrong.
Thanks


Dave Peterson

user defined function
 
Maybe you should describe what that message says.

Better yet, type in exactly the message you see.

ub wrote:

I have written a function in module1 ,
whenever I do change change in the code of the fuction and try to run, it
gives me a message to create a macro.
Please advise where I am going wrong.
Thanks


--

Dave Peterson

UB

user defined function
 
Hi, there is no problem with the UDF
But suppose I make any modification to this UDF and then try to run this
udf, system prompts me with macro window to create a macro.
please try this on yr system

"Dave F" wrote:

I just ran this UDF with no problem.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"ub" wrote:

Here's the function
Function sumvisible(rng As Range)


Application.Volatile


Dim myTotal As Double
Dim myCell As Range

Application.Volatile

myTotal = 0
For Each myCell In rng.Cells
If Application.IsNumber(myCell.Value) Then
If myCell.EntireRow.Hidden = False _
And myCell.EntireColumn.Hidden = False Then
myTotal = myTotal + myCell.Value
End If
End If
Next myCell


sumvisible = myTotal


End Function


"Dave F" wrote:

Couldn't tell you without seeing the code. Post it.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"ub" wrote:

I have written a function in module1 ,
whenever I do change change in the code of the fuction and try to run, it
gives me a message to create a macro.
Please advise where I am going wrong.
Thanks


Dave F

user defined function
 
Same thing happens: the UDF works, unless I intentionally break it. But at
no time am I asked to record a new macro.

Do you have any other macros running in the background? Such as in your
personal.xls file?

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"ub" wrote:

Hi, there is no problem with the UDF
But suppose I make any modification to this UDF and then try to run this
udf, system prompts me with macro window to create a macro.
please try this on yr system

"Dave F" wrote:

I just ran this UDF with no problem.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"ub" wrote:

Here's the function
Function sumvisible(rng As Range)


Application.Volatile


Dim myTotal As Double
Dim myCell As Range

Application.Volatile

myTotal = 0
For Each myCell In rng.Cells
If Application.IsNumber(myCell.Value) Then
If myCell.EntireRow.Hidden = False _
And myCell.EntireColumn.Hidden = False Then
myTotal = myTotal + myCell.Value
End If
End If
Next myCell


sumvisible = myTotal


End Function


"Dave F" wrote:

Couldn't tell you without seeing the code. Post it.

Dave
--
A hint to posters: Specific, detailed questions are more likely to be
answered than questions that provide no detail about your problem.


"ub" wrote:

I have written a function in module1 ,
whenever I do change change in the code of the fuction and try to run, it
gives me a message to create a macro.
Please advise where I am going wrong.
Thanks



All times are GMT +1. The time now is 11:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com