Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 915
Default Can I Assign A User Defined Function To A Cell?

Wayne wrote:
Can I assign a user defined function to a cell? I have the function
"=AUST_RWCFR_MAText" assigned to a textbox and it works well. However
I don't seem to be able to assign this function to a cell. I get a
#VALUE! error. How can I assign this function to a cell?



You can fire code when the user selects a certain cell. Place this code
in the /worksheet/ module:

Option Explicit

Private Sub Worksheet_SelectionChange _
(ByVal Target As Range)
' do something if user selects cell J10
If Not Application.Intersect _
(Target, Range("J10")) Is Nothing Then
DoSomething
End If
End Sub



The sub that does the real work can in any module you choose:

Public Sub DoSomething()
MsgBox "You selected J10."
End Sub
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
User Defined FUNCTION EAK Excel Discussion (Misc queries) 5 July 17th 08 07:07 PM
How to assign a short cut key for user defined word? Siva Excel Discussion (Misc queries) 4 August 27th 07 01:20 PM
user defined function ub Excel Worksheet Functions 6 April 4th 07 09:42 PM
Color a result cell in a user defined function aaa Excel Discussion (Misc queries) 1 May 8th 06 04:16 PM
user defined function help Floyd Steele Excel Worksheet Functions 1 February 2nd 06 10:47 PM


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

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"