LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Reading a cell that a user has clicked on


Hi all,

Is there any way in VBA it make the value of any cell that is clicked
on available to be used in the code. For example, if you had a range of
numbers and the user clicked on any one of the cells; that value they
clicked on would then be available to be used in VBA, such as in a
function. Below is what I'm trying to achieve.

The Sub and function below are in a module. The idea is that the cell
that the user clicks on is placed into memory and becomes available to
be used any where.

---------------------
Sub PutMemoryTestNumber(NewMemoryTestNumber As Single)
sngMemoryTestNumber = NewMemoryTestNumber
End Sub

Function fnMemoryTestNumber() As Single
fnMemoryTestNumber = sngMemoryTestNumber
End Function
--------------------

The subroutine below is in the form where the user clicks on the cell.

--------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
PutMemoryTestNumber THIS IS WHERE I WOULD LIKE TO ADD THE VALUE OF THE
CELL THAT THE USER HAS CLICKED ON
End Sub
-------------------

The cell that the user has clicked on would be placed into the
subroutine PutMemoryTestNumber which would then be available to the
function.

Does this make sense?

Any help would be greatly appreciated.

Best Regards,

Aaron


--
Aaron1978
------------------------------------------------------------------------
Aaron1978's Profile: http://www.excelforum.com/member.php...o&userid=31201
View this thread: http://www.excelforum.com/showthread...hreadid=548156

 
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
Reading Data from a User Form. Aaron1978 Excel Programming 2 February 5th 06 07:19 PM
Change cell value when right-clicked/double-clicked grime[_5_] Excel Programming 5 October 17th 05 01:52 PM
Code needed to test if user clicked a button Subs Excel Programming 2 September 26th 05 02:52 PM
reading a user-set autofilter value Rob[_5_] Excel Programming 3 July 23rd 05 07:47 PM
How do I check if a user clicked the Print Cancel button joanne Excel Programming 0 September 5th 03 08:24 AM


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

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

About Us

"It's about Microsoft Excel"