• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Highlight column and row of active cell but retaining the previous formats

stelios

New Member
I have found this code by searching witch is perfect

Code:
If Target.Cells.Count > 1 Then Exit Sub
Application.ScreenUpdating = False
Cells.Interior.ColorIndex = 0
With Target 'With the cell that was selected,
    .EntireRow.Interior.ColorIndex = 8
    .EntireColumn.Interior.ColorIndex = 8
End With
the point is that i want to retain the previous formating of cells when i select another cell.
and also i would like to create a switch to turn the Worksheet_SelectionChange event on and off. the tricky part is here i guess, becouse i would like when turned off to retain the previous formating also.
Any ideas?

Thanks for your help and precious time in advance.

Stelios
 
hi can any one help me on this through conditional formatting, new rule

if i write=ROW(A1)=selRow
=COLUMN(A1)=selCol

it converts into
=COLUMN(A1)=selCol
=ROW(XEV1)=selrow

& didn't get any result....

Pls suggest why iam getting error
 
Hi ,

Please post your workbook , since otherwise only general answers can be given , which may or may not be helpful.

1. Have you created the named ranges selRow and selCol ?

2. If you have used the Option Explicit statement in your VBA Editor , have you declared the variables selRow and selCol ?

The proper usage in your VBA code would be [selRow] and [selCol] , since these are worksheet named ranges , and not VBA code variables.

Narayan
 
Back
Top