Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default highlighting cells with formulas

I would like to format rows so that when I hightlight a cell it automatically
changes 1's to 0's such as the following:
39880 Alsace Ct. 0 0 0 0 0 0
when highlight address 39880, it would turn all ones to zeros and once you
un-highlight, it would change them back to 1's. Each zero represents a column.

Any suggestions on how to do this???

Thanks - MIke
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default highlighting cells with formulas

You can achieve this creating a macro. You have to insert some code in the
event Worksheet_Selectionchange

here is the code
Public rngOldTarget As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not (rngOldTarget Is Nothing) Then
rngOldTarget.Offset(0, 1).Resize(, 5).Value = 0
End If

Target.Offset(0, 1).Resize(, 5).Value = 1
Set rngOldTarget = Target
End Sub

the number 5 in the resize method is the number of columns you would like to
switch from 0 to 1.

If you want to apply this only to certain range, for example only if the
cell selected is within the range A5:A10 add the following to the code :

If Intersect(Range("A5:A10"), Target) Is Nothing Then
Exit Sub
End If

Gustavo.


"Michael Angelo" wrote:

I would like to format rows so that when I hightlight a cell it automatically
changes 1's to 0's such as the following:
39880 Alsace Ct. 0 0 0 0 0 0
when highlight address 39880, it would turn all ones to zeros and once you
un-highlight, it would change them back to 1's. Each zero represents a column.

Any suggestions on how to do this???

Thanks - MIke

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default highlighting cells with formulas

Gustavo,
Thanks for the input but I'm still lost ( novice here ). Here is what
I'm trying to accomplish. Cell "A" = Address, B,C,D,E,F,G,H all represent
days of the week and all equal 1 for the most part. When "A" goes on vacation
or stops, I would like to highlight that cell in RED at which point it would
convert cells B-H to a 0 and upon return I remove the red from cell "A" and
the numbers covert back to 1's. Does this make any sense at all. Creating a
macro would mean very detailed instructions on how to.

"Gustavo Marinoni" wrote:

You can achieve this creating a macro. You have to insert some code in the
event Worksheet_Selectionchange

here is the code
Public rngOldTarget As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not (rngOldTarget Is Nothing) Then
rngOldTarget.Offset(0, 1).Resize(, 5).Value = 0
End If

Target.Offset(0, 1).Resize(, 5).Value = 1
Set rngOldTarget = Target
End Sub

the number 5 in the resize method is the number of columns you would like to
switch from 0 to 1.

If you want to apply this only to certain range, for example only if the
cell selected is within the range A5:A10 add the following to the code :

If Intersect(Range("A5:A10"), Target) Is Nothing Then
Exit Sub
End If

Gustavo.


"Michael Angelo" wrote:

I would like to format rows so that when I hightlight a cell it automatically
changes 1's to 0's such as the following:
39880 Alsace Ct. 0 0 0 0 0 0
when highlight address 39880, it would turn all ones to zeros and once you
un-highlight, it would change them back to 1's. Each zero represents a column.

Any suggestions on how to do this???

Thanks - MIke

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default highlighting cells with formulas

You could probably be better off using CONTIDITONAL FORMATTING.
formatconditional formatting

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Michael Angelo" wrote in message
...
Gustavo,
Thanks for the input but I'm still lost ( novice here ). Here is what
I'm trying to accomplish. Cell "A" = Address, B,C,D,E,F,G,H all represent
days of the week and all equal 1 for the most part. When "A" goes on
vacation
or stops, I would like to highlight that cell in RED at which point it
would
convert cells B-H to a 0 and upon return I remove the red from cell "A"
and
the numbers covert back to 1's. Does this make any sense at all. Creating
a
macro would mean very detailed instructions on how to.

"Gustavo Marinoni" wrote:

You can achieve this creating a macro. You have to insert some code in
the
event Worksheet_Selectionchange

here is the code
Public rngOldTarget As Range

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Not (rngOldTarget Is Nothing) Then
rngOldTarget.Offset(0, 1).Resize(, 5).Value = 0
End If

Target.Offset(0, 1).Resize(, 5).Value = 1
Set rngOldTarget = Target
End Sub

the number 5 in the resize method is the number of columns you would like
to
switch from 0 to 1.

If you want to apply this only to certain range, for example only if the
cell selected is within the range A5:A10 add the following to the code :

If Intersect(Range("A5:A10"), Target) Is Nothing Then
Exit Sub
End If

Gustavo.


"Michael Angelo" wrote:

I would like to format rows so that when I hightlight a cell it
automatically
changes 1's to 0's such as the following:
39880 Alsace Ct. 0 0 0 0 0 0
when highlight address 39880, it would turn all ones to zeros and once
you
un-highlight, it would change them back to 1's. Each zero represents a
column.

Any suggestions on how to do this???

Thanks - MIke


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
Highlighting cells Justin Excel Discussion (Misc queries) 0 August 15th 07 05:14 PM
Highlighting Cells perezianda Excel Worksheet Functions 3 October 19th 06 11:39 PM
highlighting cells robbie Excel Discussion (Misc queries) 1 September 21st 06 11:26 AM
HIGHLIGHTING CELLS Dave803 Excel Discussion (Misc queries) 6 November 28th 05 12:29 AM
Highlighting blanks via GO TO SPECIAL is not highlighting blank cells - HELP, I'm totally stuck. Jamie Furlong Excel Discussion (Misc queries) 6 August 28th 05 09:27 PM


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

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

About Us

"It's about Microsoft Excel"