help selecting a cell


Posted by steve on February 22, 2001 10:26 PM

Does anyone have an idea on how I can do this. I have a range of cells lets say A1 to S1 all the cells have prices for a different product. I want to be able to click on anyone of these cells and have the price apeer in cell T1. I want to do the same for multiple rows A2 to S2, A3 to S3 and so on.

Posted by David Hawley on February 23, 2001 12:18 AM


Hi Steve

Right click on the sheet name tab and select "View Code", paste this code in.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim WatchRange As Range
If Target.Cells.Count > 1 Then Exit Sub
If IsEmpty(Target) Then Exit Sub
On Error Resume Next
Set WatchRange = Range("A1:S10")
If Not Intersect(Target, WatchRange) Is Nothing Then
Range("T1") = Target
End If
Set WatchRange = Nothing
End Sub


Change Range("A1:S10") to suit. Push Alt+Q.

Any good ?

Dave

OzGrid Business Applications

Posted by steve on February 23, 2001 6:22 AM

Dave I also wanted to have mutiple targets T4,T5,T6 ...

Thanks for the help

Posted by Dave Hawley on February 23, 2001 6:36 AM


Do you mean if they select cell say A10 you want T10 to contain the contents of A1, if they select A2 you want T2 to contain the contents of A2 etc ?

What happens if they select R50 or K13 ect ?

Dave

OzGrid Business Applications



Posted by STEVE on February 23, 2001 4:30 PM


THATS CORRECT!
I WANT TO HAVE 28 ROWS A4 TO S4 AND T4 TO CONTAIN THE SELECTION( LETS SAY IF ANYTHING IN THE RANGE OF A4 TO S4 ONLY BE DISPLAYED IN T4 AND SO ON FOR EACH ROW) AND TO REPEAT FOR ROW 5-32 AND TO HAVE T5-T32 CONTAIN THE SELECTIONS FOR EACH ROW. I WANT ALL THE ROWS TO BE INDEPENDENT I WOULD ALSO LIKE TO FIND A WAY OF CIRCLEING THE CELL THAT WAS SELECTEDAND TO HAVE IT CHANGE IF YOU PICK A DIFFERENT CELL IN THE SAME ROW.


THANKS STEVE