ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   VBA-Application (https://www.excelbanter.com/excel-discussion-misc-queries/119442-vba-application.html)

Gaurav Jindal

VBA-Application
 
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.

Bob Phillips

VBA-Application
 


--

HTH

Bob Phillips

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

"Gaurav Jindal" <Gaurav wrote in message
...
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.




Bob Phillips

VBA-Application
 
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)

"Gaurav Jindal" <Gaurav wrote in message
...
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.





All times are GMT +1. The time now is 07:01 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com