Re: How to test an adjacent cell for blank in conditional formatting
- From: "davegb" <davegb@xxxxxxxxxxxxxx>
- Date: 28 Mar 2007 11:26:33 -0700
On Mar 28, 12:16 pm, "davegb" <dav...@xxxxxxxxxxxxxx> wrote:
On Mar 28, 8:51 am, Dave Peterson <peter...@xxxxxxxxxxxxxxxx> wrote:
Just use the adjacent cell's address in the formula:
If A1 is the activecell:
formula is:
=B1<>""
or
=B1=""
depending on what you want.
Or add it to an existing rule:
=and(B1<>"",yourformulahere)
davegb wrote:
On Mar 28, 6:08 am, Dave Peterson <peter...@xxxxxxxxxxxxxxxx> wrote:
In code?
dim myCell as range
set mycell = active***.range("b99")
if isempty(mycell.offset(0,1).value) then
msgbox "the cell to the right is empty--no formula, no nothing!"
end if
If you want to check to see if it contains a formula that evaluates to "" or is
empty:
if mycell.offset(0,1).value = "" then
davegb wrote:
I want to test to see if an adjacent cell is blank or not to change
the formatting of the cell in question. I would guess it might involve
the Offset property. Does anyone know how to do this?
Thanks!
--
Dave Peterson
Thanks for your reply, Dave. I know how to do it in code, I want to
know how to do it in conditional formatting.
--
Dave Peterson- Hide quoted text -
- Show quoted text -
Thanks for your reply. I tried putting in =AND($A2<>"") and then put
it to format it with an underline, but it doesn't work.
Let me explain what I'm trying to do. I'm keeping a list of daily
activities. In col A I put the date. In Col B I put a description of
what I did. In Col C, I put it who I did it for. There can be any
number of entries in Cols B and C for every date entry in Col A. I
want Col A to change to a different color when there is a date in that
cell, and I want a border on the top edge of that cell to separate it
from the previous day's list. Then, in Cols B and C, I want them to be
a different color and to put an edge on the top of the cell when
there's a date in Col A. So as I add new activites and persons to the
list, the cell colors change from background to a selected cell
shading. Only when there is a date in Col A do I want Col A, B and C
to have a border at the top of all 3 cells as a separator.
I can get one thing or the other to happen, change cell color or put a
border at the top, with conditional formatting, but when I try to do
both, the border disappears.
I hope this is clearer than before.- Hide quoted text -
- Show quoted text -
I just went back and tried some more things. I figured out that when a
cell is conditionally shaded, the borders, if conditionally placed,
dissappear. So I can put in the condition to create a border, but if I
also try to shade the cell, the border dissappears. Is this a glitch
or by design? More importantly, is there a way around it?
.
- Follow-Ups:
- Re: How to test an adjacent cell for blank in conditional formatting
- From: Dave Peterson
- Re: How to test an adjacent cell for blank in conditional formatting
- References:
- How to test an adjacent cell for blank in conditional formatting
- From: davegb
- Re: How to test an adjacent cell for blank in conditional formatting
- From: Dave Peterson
- Re: How to test an adjacent cell for blank in conditional formatting
- From: davegb
- Re: How to test an adjacent cell for blank in conditional formatting
- From: Dave Peterson
- Re: How to test an adjacent cell for blank in conditional formatting
- From: davegb
- How to test an adjacent cell for blank in conditional formatting
- Prev by Date: Re: Importing text into a Text Box
- Next by Date: Re: sense conditional formating
- Previous by thread: Re: How to test an adjacent cell for blank in conditional formatting
- Next by thread: Re: How to test an adjacent cell for blank in conditional formatting
- Index(es):