Highlighting rows using arrow keys

christal

New Member
Joined
Apr 7, 2002
Messages
45
I have a list of items in column A, with prices for those items in column B - Z. I want the viewer to easily see the the items and their corresponding prices, while using the arrow key to move up and down the item list. Is there a way to move up and down the item list with your arrow keys, while highlighting the whole row of data?

Appreciate any help on this simple problem!

Thanks
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
quick and dirty: simply select tthe row by clicking on the leftmost column (before column A): the whole row will be highlighted
 
Upvote 0
I was able to figure out this part, but I wanted to be able to scroll up and down on the item list only...., not clicking with my mouse on the row number.

Any ideas??

Sorry for not being too clear before!

Thanks
 
Upvote 0
Try this...

Go into the Visual basic editor and double click on the worksheet you want this to work for. Paste into it the following code...



Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells.Interior.ColorIndex = xlNone
Target.EntireRow.Interior.ColorIndex = 36
End Sub


If you want this slightly altered, so that it does not remove heading formats, or so that it only works for certain rows or rows with certain values, reply again with details.

Hope this works for you.
 
Upvote 0
O.K... Sorry to have to say this... But :eek:(

I have never done any work in VB. So I tried going into VB and double clicking on the sheet number and a window pop-up where I selected worksheet and section change. Pasted the code in and saved the update and went back into excel to see what damage I did. Nothing happened!! Got any ideas for this "bush-leaguer"??

Thanks for the great help!
This message was edited by christal on 2002-04-15 07:06
 
Upvote 0
The code should work. Follow the below steps:

1. In Excel, hit Alt+F11 to open VBA
2. Look on the left of the VBA window for "VBAProject"
3. Double click your sheet name that you want to hightlight rows.
4. Look to the left for the big blank page and paste the following code:
Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range) 
Cells.Interior.ColorIndex = xlNone 
Target.EntireRow.Interior.ColorIndex = 3 
End Sub
5. Close the VBA window to return to excel. And click in a cell and watch the whole row be highlighted.
6. Make sure that you have macros enabled (ie make sure you are not running on high level security).
 
Upvote 0
That was a great help....BUT, I couldn't get it to work on the spreadsheet I needed it to work on. I got the function to work on a blank spreadsheet... so I know it wasn't something I did! I checked the security options, and those are O.K.!! Any further ideas??

Thanks again!!
 
Upvote 0
start again, then. go into the vb editor, double click on the sheet you need the code to work on, this should open the module.

Delete everything in it, and paste the code.

then save the workbook, close it, then open it again, sometimes this works!

Good luck.
 
Upvote 0
Thanks Daleyman.....

I was already ahead of you... I tried deleting the code and doing it over again, and it didn't work. But I did copy and paste the data to a new workbook, and cut and paste the VB code in again. And to my surprise it worked!! Yeppie!! But I will tell you one thing.. you cannot apply any patterns to cells after the VB code has been put in... so I had to delete the code, and then format the cells again. Thanks for all your help!!

Christal
 
Upvote 0
I was able to cut and paste the VB code into the editor, and YES, it finally worked! Problem now, is that the color that I had on my Excel spreadsheet is now gone! Does anyone have an idea, as to how I can keep the color format and still use the highlighted scrolling function?

Much thanks!

Christal
 
Upvote 0

Forum statistics

Threads
1,214,411
Messages
6,119,360
Members
448,888
Latest member
Arle8907

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top