- Public Function Test(rng As Range) As Double
-
Set oRng = Application.ActiveSheet.Range("A1", "A3")
-
oRng.Formula = "=C3+C5"
-
Test = 0
-
End Function
I don't know if the problem is that it's not possible to modify the "Formula" property of a cell from a custom formula.
Is there any solution?
Thanks for your help!
1 1047 - Public Function Test(rng As Range) As Double
-
Set oRng = Application.ActiveSheet.Range("A1", "A3")
-
oRng.Formula = "=C3+C5"
-
Test = 0
-
End Function
I don't know if the problem is that it's not possible to modify the "Formula" property of a cell from a custom formula.
Is there any solution?
Thanks for your help!
Not sure exactly what the problem is here, but there are a couple of things which stand out... - Where is oRng defined? How does it relate to the parameter rng that was passed to the function?
- Have you tried commenting out lines of code (starting with all of them commented) to work out exactly where it's hanging?
- I'm not that familiar with Excel's VBA, so bear with me - is it possible to set .Formula for a range like this, as opposed to an individual cell?
- Is it possible you have set up some sort of circular reference? For example, is there a formula in cell C3 or C5 which refers to the Test() function? In that case, your function might be causing a calculation which calls your function, which causes a calculation which calls your function, which causes a calculation which calls your function, which causes a calculation which calls your function, ... I think you get the idea - see why that would get hung up?
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Lize |
last post by:
Hi,
I'm writing an ASP application to open an excel workbook, then run a
macro stored in the excel file, which produces outputs that will be
displayed back onto my ASP application.
Now the...
|
by: Dim |
last post by:
Hi,
need some help/idea...
I have data table in Excel(about 30 columns) and it's getting too big
(over 65K) so I need to move it to DB (MS Access is the choice)
one of the columns (for example...
|
by: lina |
last post by:
Hi,
In acc2000, can i export a tbl/qry to xls while having formula written
in the table? In my sample table the Excel didn't recognize the data as
formula (=C2+D2). But, when in Excel, i enter the...
|
by: prakashsakthivel |
last post by:
Hi Members,
What I want to know is, I want to detect formula which cells has formula and converted as text.
let us example,
One excel workbook have 4 sheet. all cells of each sheet contains...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |