Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Identify the Current Cell

I would like to highlight/shade a certain cell in whichever row I am
currently working on. For example, whenever I am anywhere on row 10 I would
like cell A10 to be highlighted or shaded a certain colour, and similarly for
row 11 cell A11 etc. I have been looking for a function like ACTIVEROW or
ACTIVECELL so that I can then use conditional formatting, but can't find
anything.
I am using EXCEL 2007.

Please help. Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Identify the Current Cell

How about this? Be aware, it will destroy any other CF you have


'----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------
Cells.FormatConditions.Delete
With Target
With .EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
With .Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
.Interior.ColorIndex = 20
End With
End With
With .EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
With .Borders(xlRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
.Interior.ColorIndex = 20
End With
End With

.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 36
End With

End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Staanley" wrote in message
...
I would like to highlight/shade a certain cell in whichever row I am
currently working on. For example, whenever I am anywhere on row 10 I
would
like cell A10 to be highlighted or shaded a certain colour, and similarly
for
row 11 cell A11 etc. I have been looking for a function like ACTIVEROW or
ACTIVECELL so that I can then use conditional formatting, but can't find
anything.
I am using EXCEL 2007.

Please help. Thanks.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Identify the Current Cell

Have a look here

http://www.cpearson.com/excel/RowLiner.htm

Mike

"Staanley" wrote:

I would like to highlight/shade a certain cell in whichever row I am
currently working on. For example, whenever I am anywhere on row 10 I would
like cell A10 to be highlighted or shaded a certain colour, and similarly for
row 11 cell A11 etc. I have been looking for a function like ACTIVEROW or
ACTIVECELL so that I can then use conditional formatting, but can't find
anything.
I am using EXCEL 2007.

Please help. Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Identify the Current Cell

Bob,
Thanks very much. The problem I have is that the worksheet is quite heavily
formatted and I guess this would destroy that.
I would say I am a fairly competent EXCEL user, but am not an expert, so I
hope I have not misunderstood you.
Cheers,
Ian.

"Bob Phillips" wrote:

How about this? Be aware, it will destroy any other CF you have


'----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------
Cells.FormatConditions.Delete
With Target
With .EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
With .Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
.Interior.ColorIndex = 20
End With
End With
With .EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
With .Borders(xlRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
.Interior.ColorIndex = 20
End With
End With

.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 36
End With

End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Staanley" wrote in message
...
I would like to highlight/shade a certain cell in whichever row I am
currently working on. For example, whenever I am anywhere on row 10 I
would
like cell A10 to be highlighted or shaded a certain colour, and similarly
for
row 11 cell A11 etc. I have been looking for a function like ACTIVEROW or
ACTIVECELL so that I can then use conditional formatting, but can't find
anything.
I am using EXCEL 2007.

Please help. Thanks.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,593
Default Identify the Current Cell

It won't destroy formatting, other than any conditional formatting It does
destroy that I am afraid.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Staanley" wrote in message
...
Bob,
Thanks very much. The problem I have is that the worksheet is quite
heavily
formatted and I guess this would destroy that.
I would say I am a fairly competent EXCEL user, but am not an expert, so I
hope I have not misunderstood you.
Cheers,
Ian.

"Bob Phillips" wrote:

How about this? Be aware, it will destroy any other CF you have


'----------------------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'----------------------------------------------------------------
Cells.FormatConditions.Delete
With Target
With .EntireRow
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlTop)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
With .Borders(xlBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
.Interior.ColorIndex = 20
End With
End With
With .EntireColumn
.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
With .FormatConditions(1)
With .Borders(xlLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
With .Borders(xlRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = 5
End With
.Interior.ColorIndex = 20
End With
End With

.FormatConditions.Delete
.FormatConditions.Add Type:=xlExpression, Formula1:="TRUE"
.FormatConditions(1).Interior.ColorIndex = 36
End With

End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"Staanley" wrote in message
...
I would like to highlight/shade a certain cell in whichever row I am
currently working on. For example, whenever I am anywhere on row 10 I
would
like cell A10 to be highlighted or shaded a certain colour, and
similarly
for
row 11 cell A11 etc. I have been looking for a function like ACTIVEROW
or
ACTIVECELL so that I can then use conditional formatting, but can't
find
anything.
I am using EXCEL 2007.

Please help. Thanks.








  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Identify the Current Cell

Mike,

Thanks very much - this is excellent.

Cheers,
Ian.


"Mike H" wrote:

Have a look here

http://www.cpearson.com/excel/RowLiner.htm

Mike

"Staanley" wrote:

I would like to highlight/shade a certain cell in whichever row I am
currently working on. For example, whenever I am anywhere on row 10 I would
like cell A10 to be highlighted or shaded a certain colour, and similarly for
row 11 cell A11 etc. I have been looking for a function like ACTIVEROW or
ACTIVECELL so that I can then use conditional formatting, but can't find
anything.
I am using EXCEL 2007.

Please help. Thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identify if a cell contains a numerical string Pierre Excel Worksheet Functions 3 January 15th 08 06:58 PM
Identify the cell with Max & Min values skysusan Excel Worksheet Functions 1 November 8th 06 03:04 AM
Identify current active cell reades Excel Worksheet Functions 6 January 10th 06 12:48 PM
How to identify a cell without a formula Kevin Excel Discussion (Misc queries) 5 May 14th 05 11:42 PM
Identify if a cell is referenced by other cells drhayes Excel Worksheet Functions 4 February 25th 05 02:12 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"