Page 1 of Excel Query

General Forum

Excel Query

gordyffc (Elite) posted this on Monday, 22nd July 2002, 10:34

I`m pretty sure this is possible and is probably so simple that I have missed it.

I want to somehow link cell C1 to the position of the cursor i.e. if the cursor is in cell A1 then C1 would = red, if the cursor was in cell A2 then C1 would = Blue etc etc so as you scroll down A1-A5 then C1 automatically changes.


A B C D

1 Red ***
2 Blue
3 Green
4 Orange
5 Yellow
6
7

Any help appreciated.

Cheers
Gordy

PS when I posted this the example above looked like a spreadsheet but it has condensed. Hopefully you still know what I am trying to do.

This item was edited on Monday, 22nd July 2002, 11:24

RE: Excel Query

Richard_lench (Competent) posted this on Monday, 22nd July 2002, 11:41

From what I remember from my A Level ICT, you can do this with a V-Lookup table. Have you tried this? I personally hate using Vlookup because it is difficult to set up and isn`t really worth it IMO. It makes a table of information that you need to input into the sheet and changed another cell based on that information.

I can`t remember how to use it to sort you out though, never did anything like that in my project. Anyway try looking for help on Vlookup in Excel. That should sort your problem out.

RE: Excel Query

gordyffc (Elite) posted this on Monday, 22nd July 2002, 12:06

Hi Richard,

I tried Vlookup as well as loads of other functions but can`t get it to do what I want.

There must be some way to link a cell to the cursor position but I just can`t find it and it is beginning to do my nut in :0(

Thanks anyway.

RE: Excel Query

Richard_lench (Competent) posted this on Monday, 22nd July 2002, 14:41

Hi. Sorry it wasn`t that then. Don`t think I know how to do it then, it was almost 2 years since I did my Excel project and have forgotten how to do some of the more complex stuff. I will ask my mates who know about Excel to try and help out.
Richard

RE: Excel Query

sj (Elite) posted this on Monday, 22nd July 2002, 16:19

I use Excel a fair bit and I`ve not heard you could do this. You could make the contents of a cell change colour depending on it`s (or another cells VALUE (conditional formatting) but not just by where you happen to have clicked.. Let me know if you find out how..

Ste

RE: Excel Query

gordyffc (Elite) posted this on Monday, 22nd July 2002, 17:00

Richard/sj

Finally cracked it with a little help from microsoft`s newsgroups.

I had to create a worksheet selection change event macro. Right click the worksheet then enter the following code:-

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If TypeName(Target.Value) = "String" Then Range("C1").Value = Target.Value
End Sub

So if the cursor is on a cell that is = to "string" or text then it will appear in cell C1 and change as you scroll down.

Happy man now :0)

Cheers
Gordy

RE: Excel Query

Richard_lench (Competent) posted this on Monday, 22nd July 2002, 17:26

Well done for finally cracking it. I`d been messing about on Excel looking for a way to do it. Couldnt find anything, had just started testing macros to change cell colour etc but couldnt get one to work properly. Oh well.

Go back to General Forum threads, or All Forum threads