ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Code for testing whether a cell or row is highlighted? (https://www.excelbanter.com/excel-programming/390242-code-testing-whether-cell-row-highlighted.html)

J@Y

Code for testing whether a cell or row is highlighted?
 
I need something that is to the purpose of:
if the cell is highlighted, copy the row and paste it here.

What is the code for testing whether a cell or row is highlighted?

Thanks.

Otto Moehrbach

Code for testing whether a cell or row is highlighted?
 
What do you mean by "highlighted". HTH Otto
"J@Y" wrote in message
...
I need something that is to the purpose of:
if the cell is highlighted, copy the row and paste it here.

What is the code for testing whether a cell or row is highlighted?

Thanks.




Gary''s Student

Code for testing whether a cell or row is highlighted?
 
Sub colortest()
If ActiveCell.Interior.ColorIndex = xlNone Then
MsgBox ("not colored")
Else
MsgBox ("colored")
End If
End Sub

--
Gary''s Student - gsnu200725

J@Y

Code for testing whether a cell or row is highlighted?
 
Great simple solution. Thanks.

"Gary''s Student" wrote:

Sub colortest()
If ActiveCell.Interior.ColorIndex = xlNone Then
MsgBox ("not colored")
Else
MsgBox ("colored")
End If
End Sub

--
Gary''s Student - gsnu200725


Gary''s Student

Code for testing whether a cell or row is highlighted?
 
You are welcome
Simple is always good.
--
Gary''s Student - gsnu200725


"J@Y" wrote:

Great simple solution. Thanks.

"Gary''s Student" wrote:

Sub colortest()
If ActiveCell.Interior.ColorIndex = xlNone Then
MsgBox ("not colored")
Else
MsgBox ("colored")
End If
End Sub

--
Gary''s Student - gsnu200725



All times are GMT +1. The time now is 06:23 AM.

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