Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi all,
Is it possible to have a table where I select a cell to type a value in it and by doing so, another cell is highlighted? For example when I select "April's price" to type a value in it, it automatically highlights "March's price" while I am in that cell. I mean to use it just as a visual aid to type values that keeping in mind another cell's value is handy. thankyou! |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Ed
No way through formulas or the UI or anything, but you could paste some code in the Worksheet_SelectionChange() event (right-click on a sheet tab and select view code...) The code below colours the cell one to the right of the selected cell in red. If you need more specific help with the code or implimentation, post back Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then Columns("B:B").Interior.ColorIndex = xlNone Target.Offset(0, 1).Interior.Color = RGB(255, 0, 0) End If End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England www.nickhodge.co.uk HIS "Ed" wrote in message ... Hi all, Is it possible to have a table where I select a cell to type a value in it and by doing so, another cell is highlighted? For example when I select "April's price" to type a value in it, it automatically highlights "March's price" while I am in that cell. I mean to use it just as a visual aid to type values that keeping in mind another cell's value is handy. thankyou! |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hello Nick, thanks, the code works great, I more or less understand part of
it, enough to choose the column that gives the highlight and the one that is highlighted... There are somethings that I would like to know if they can be changed. When I am in the column which gives the highlight to the other, if I switch to a different column the last cell that was highlighted stays highlighted. Also if I am in the column which gives the highligt and I select a range of cells, the highlight goes as well to other cells and stays like that. Would you know how to make the last cell highlight go away when I leave the cell? Does anybody know webpage where I can learn more about codes? thanks a lot! Ed |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Ed
Does this help? Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not Application.Intersect(Target, Columns("A:A")) Is Nothing Then Columns("B:B").Interior.ColorIndex = xlNone Target.Offset(0, 1).Interior.Color = RGB(255, 0, 0) Exit Sub End If Columns("B:B").Interior.ColorIndex = xlNone End Sub The addition checks to see that the selection is in column A, if it is it highlights the cell directly to it's right (offset(0,1)), if the selection isn't in column A then it jumps the if...then...end if statement and runs the last columns("B:B") part to clear any colouring from column B Hope that is what you were looking for? -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England www.nickhodge.co.uk HIS "Ed" wrote in message ... Hello Nick, thanks, the code works great, I more or less understand part of it, enough to choose the column that gives the highlight and the one that is highlighted... There are somethings that I would like to know if they can be changed. When I am in the column which gives the highlight to the other, if I switch to a different column the last cell that was highlighted stays highlighted. Also if I am in the column which gives the highligt and I select a range of cells, the highlight goes as well to other cells and stays like that. Would you know how to make the last cell highlight go away when I leave the cell? Does anybody know webpage where I can learn more about codes? thanks a lot! Ed |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
It's perfect now Nick!
thank you! Ed |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Named formulas in CHOOSE need to be Relative references when paste | Excel Worksheet Functions | |||
Relative Hyperlinks to local files | Links and Linking in Excel | |||
Relative Ranges in excel macro | Excel Discussion (Misc queries) | |||
Relative Ranges in excel macro | Excel Worksheet Functions | |||
Cells in Excel will not stop highlighting | Excel Discussion (Misc queries) |