Highligh a cell on same row as active.cell whenever active.cell changes

  • Aim: whenever the active cell is within a given range, highlight the cell on the same row in column S (by changing its interior colour). This should occur each time the active cell is changed, whether by cursor keys or mouse. The effect would be similar to the row and column highlights at left and top of the worksheet.


    This action should be restricted to one sheet in the workbook.


    I've no idea how to go about this, so any suggestions would be gratefully received. It's for Excel 2003.


    Thanks!

  • Re: Highligh a cell on same row as active.cell whenever active.cell changes


    Try using the worksheet_selectionChange event like this:



    cheers!
    Nate

  • Re: Highligh a cell on same row as active.cell whenever active.cell changes


    Thanks, Nate, but nothing happens! What might I be doing wrong? I'd been trying something similar (picked up from another thread) but that didn't work either. Presumably "Worksheet_SelectionChange" runs the macro each time the cursor is moved.


    Richard

  • Re: Highligh a cell on same row as active.cell whenever active.cell changes


    OK, got it now—it needs to be in the specific sheet module. Works like a charm! Many thanks indeed.


    Just one thing, though. I get an "Object doesn't support this property or method" code error on the lines


    .TintAndShade = 0
    .PatternTintAndShade = 0


    and also on


    .Pattern = xlSolid


    which I added to the required cell colour. Odd, considering that I got the latter from a recorded macro.


    Thanks again,


    Richard

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!