Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default How to select Cell address between Specified Range

If user click between Range("A1:A10") only then i would like to return the
address of the selected cell for calculation purpose. Is it possible in vba ?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 638
Default How to select Cell address between Specified Range

Look at the Selection_Change event of the worksheet where you want
this to happen:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1:A10")) _
Is Nothing Then MsgBox Target.Address
End Sub

Max wrote:
If user click between Range("A1:A10") only then i would like to return the
address of the selected cell for calculation purpose. Is it possible in vba ?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How to select Cell address between Specified Range

msgbox Selection.Address & ", " & ActiveCell.Address

--
Regards,
Tom Ogilvy


"Max" wrote:

If user click between Range("A1:A10") only then i would like to return the
address of the selected cell for calculation purpose. Is it possible in vba ?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default How to select Cell address between Specified Range

and here is another interpretation:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Selection, _
Range("A1:A10")) Is Nothing Then
MsgBox Target.Address
End If
End Sub

Right click on the sheet tab and select view code - then paste in the above.

--
Regards,
Tom Ogilvy


"Max" wrote:

If user click between Range("A1:A10") only then i would like to return the
address of the selected cell for calculation purpose. Is it possible in vba ?

  #5   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 390
Default How to select Cell address between Specified Range

Thanx JW,
Your solution solve my problem.


"JW" wrote:

Look at the Selection_Change event of the worksheet where you want
this to happen:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Not Intersect(Target, Range("A1:A10")) _
Is Nothing Then MsgBox Target.Address
End Sub

Max wrote:
If user click between Range("A1:A10") only then i would like to return the
address of the selected cell for calculation purpose. Is it possible in vba ?



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
I am trying to select a new cell whose row address is based on a variable rub Excel Programming 4 November 29th 06 03:49 AM
Is is possible to have a macro select a cell and return the address for use as a variable? JasonK Excel Programming 1 March 21st 06 01:08 PM
select range and put range address in variable [email protected] Excel Programming 2 January 25th 06 01:28 AM
Select Cell based on Variable address achidsey Excel Programming 2 September 17th 05 06:47 PM
How do you select a cell with an "absolute" address with a cursor? New Daddy New Users to Excel 1 August 11th 05 02:19 PM


All times are GMT +1. The time now is 05:33 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"