Updating spreadsheet values using functions vba

However, the method I listed above is much more reliable. I used a similar approach but instead of using Workseet_calculate, I used App_Sheet Change which will look for function completion event(cell A4 gets True) and then reads the global variable and displays on Excel grid.

This works very nice but I would like to have my own event, say Print Grid( by using Event keyword and raising by Raise Event) but the event handler gives error while writing to the range of cells.my questin - SO my question - Is it possible to modify excel cells from custom event handlers that are triggered manually from UDF using Raise Event ?

Example: Sub UDFfunction() Dim s As string s="Text" Evaluate "otherfunc(""" & s & """)" End Sub Function c() End Function ---------------- Public Function otherfunc(By Val str As String) Active Sheet.

Public Sub Update My Functions() Dim my Range As Range Dim rng As Range 'Considering The Functions are in Range A1: B10 Set my Range = Active Sheet. When I tried all the solutions proposed here there was no improvement, the user defined function appeared not to recalculate despite having Application. Public Sub Update My Functions() Dim my Range As Range Dim rng As Range 'Considering The Functions are in Range A1: B10 Set my Range = Active Sheet.

To learn how to use the Webservice function, we’ll do 2 things: First, find a web service.

If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.

(12 printed pages)In this scenario, the developer wants each user to add a worksheet to the workbook, and then to have Excel automatically name and sort all of the worksheets in the workbook.

If you want Excel to perform these actions automatically after a user enters the name of the new worksheet in a cell, you must write your VBA code in an subroutine.

Now instead using Application Events, I want to use my own Events( say Print Grid) that I created using Event keyword but my testing shows that the custom event handler throws error when attempting to modify excel cells.

SO my question - Is it possible to modify excel cells from custom event handlers that are triggered manually from functions using Raise Event event to do... Another more complicated approach would be to write a vbscript file from your function that will attempt to automate Excel and run it via Shell.

Leave a Reply