VBA-Application

G

Gaurav Jindal

Hi,
I want to highlight the row & column corresponding to the cell which is
currently selected.For that i m using the following macro:-

Private Sub Worksheet_SelectionChange(ByVal Target _
As Excel.Range)
Cells.Interior.ColorIndex = xlNone
With ActiveCell
.EntireRow.Interior.ColorIndex = 36
.EntireColumn.Interior.ColorIndex = 36
End With
End Sub

My only problem is that when i am using this & copying that particular
cell,as soon as move it to paste on some other cell my copy command get
cancel.Can anyone help me on this that I can use my excel worksheet i a
normal way & apply all commands on it.
 
B

Bob Phillips

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 
B

Bob Phillips

Private Sub Worksheet_SelectionChange(ByVal Target _
As Excel.Range)
If Application.CutCopyMode = False Then
Cells.Interior.ColorIndex = xlNone
With ActiveCell
.EntireRow.Interior.ColorIndex = 36
.EntireColumn.Interior.ColorIndex = 36
End With
End If
End Sub


--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top