ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet shakes like Rock n' Roll - A command like Cells_Change would have been nice (https://www.excelbanter.com/excel-programming/297135-worksheet-shakes-like-rock-n-roll-command-like-cells_change-would-have-been-nice.html)

No Name

Worksheet shakes like Rock n' Roll - A command like Cells_Change would have been nice
 
How can I run my format keeping code only when a range of cells changes?

I'm looking for a solution to keep my format in some cell areas in column
B:B. The format need to be of two different choices, depending on if you got
an "I" or an "K" in the cell to the left, in A:A column.

It should allow users to copy and paste as they use to do, without ruin the
code. I tried with a code creating format conditioning rules with For
....Step 1 ... Next for all cells, running at Sub Worksheet_Change, but it
shakes like rock and roll every time you make a change.

I just want to make a check in the cell to the left for that specific row
the
change took place, if that is possible. Font black if RC-1 is "K" and blue
if it is "I",

I have tried to start from a macro when recording format conditioning in
excel. A part of it look of cource like this:
...
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=$A$6:$A$102=""I"""
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 1
End With
.... etc

If I want to run code with Sub Worksheet_Change, I guess I had to have a
compleate other approach than "=$A$6:$A$102=""I""" Right?

Because if I let code create the conditional format on every worksheet
changes, it shakes like rock n roll...

Any suggestions??

/My regards



Frank Kabel

Worksheet shakes like Rock n' Roll - A command like Cells_Change would have been nice
 
Hi
one question first: Why don't you manually apply a custom
format for the desired range?
-----Original Message-----
How can I run my format keeping code only when a range of

cells changes?

I'm looking for a solution to keep my format in some cell

areas in column
B:B. The format need to be of two different choices,

depending on if you got
an "I" or an "K" in the cell to the left, in A:A column.

It should allow users to copy and paste as they use to

do, without ruin the
code. I tried with a code creating format conditioning

rules with For
....Step 1 ... Next for all cells, running at Sub

Worksheet_Change, but it
shakes like rock and roll every time you make a change.

I just want to make a check in the cell to the left for

that specific row
the
change took place, if that is possible. Font black if RC-

1 is "K" and blue
if it is "I",

I have tried to start from a macro when recording format

conditioning in
excel. A part of it look of cource like this:
...
Selection.FormatConditions.Delete
Selection.FormatConditions.Add Type:=xlExpression,

Formula1:= _
"=$A$6:$A$102=""I"""
With Selection.FormatConditions(1).Font
.Bold = True
.Italic = False
.ColorIndex = 1
End With
.... etc

If I want to run code with Sub Worksheet_Change, I

guess I had to have a
compleate other approach than "=$A$6:$A$102=""I""" Right?

Because if I let code create the conditional format on

every worksheet
changes, it shakes like rock n roll...

Any suggestions??

/My regards


.



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

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