Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Stefi
 
Posts: n/a
Default forcing UDF to run

Hi All,

I have a very simple UDF returning the address of the selected cell:

Public Function AktCell() As String
AktCell = ActiveCell.Address(False, False)
End Function

It works fine when I newly insert it in a cell, but doesn't refresh the cell
when I select another cell despite I have a Calculation line a
Selection_change event!

How can I force the UDF to run when selecting a new cell?

Thanks,
Stefi

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Peo Sjoblom
 
Posts: n/a
Default forcing UDF to run

Add this

application.volatile

--
Regards,

Peo Sjoblom

(No private emails please)


"Stefi" wrote in message
...
Hi All,

I have a very simple UDF returning the address of the selected cell:

Public Function AktCell() As String
AktCell = ActiveCell.Address(False, False)
End Function

It works fine when I newly insert it in a cell, but doesn't refresh the
cell
when I select another cell despite I have a Calculation line a
Selection_change event!

How can I force the UDF to run when selecting a new cell?

Thanks,
Stefi


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default forcing UDF to run

There is nothing in the function that forces a recalculation of the
function. Even if you put Application.Volatile in there it will only
recalculate when you have something that forces a sheet
recalculation.selecting another cell does not do that

You can do it with an event procedure


Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Range("showactive").Value = Target.Address(False, False)
End Sub

where showactive is the name of a cell to show the active cell address

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Stefi" wrote in message
...
Hi All,

I have a very simple UDF returning the address of the selected cell:

Public Function AktCell() As String
AktCell = ActiveCell.Address(False, False)
End Function

It works fine when I newly insert it in a cell, but doesn't refresh the

cell
when I select another cell despite I have a Calculation line a
Selection_change event!

How can I force the UDF to run when selecting a new cell?

Thanks,
Stefi



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Stefi
 
Posts: n/a
Default forcing UDF to run

Fine, it works, thanks!

Regards,
Stefi


€˛Peo Sjoblom€¯ ezt Ć*rta:

Add this

application.volatile

--
Regards,

Peo Sjoblom

(No private emails please)


"Stefi" wrote in message
...
Hi All,

I have a very simple UDF returning the address of the selected cell:

Public Function AktCell() As String
AktCell = ActiveCell.Address(False, False)
End Function

It works fine when I newly insert it in a cell, but doesn't refresh the
cell
when I select another cell despite I have a Calculation line a
Selection_change event!

How can I force the UDF to run when selecting a new cell?

Thanks,
Stefi



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Forcing Cell Entries to be Upper Case Colin James Excel Worksheet Functions 9 June 22nd 08 02:43 PM
Forcing data value in a cell Trying2Learn Excel Discussion (Misc queries) 2 November 14th 05 11:16 PM
Forcing Excel to Load Below Office Toolbar Bill Helbron Excel Discussion (Misc queries) 2 October 2nd 05 04:09 PM
Forcing page breaks Peter Cartwright Excel Discussion (Misc queries) 7 January 13th 05 03:03 AM
Forcing text onto new line in cell Doug Poll New Users to Excel 2 December 3rd 04 12:09 PM


All times are GMT +1. The time now is 12:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"