Conditional Formating issue

  • Thread starter Thread starter jurgenC!
  • Start date Start date
J

jurgenC!

hi all,

i am trying to add a Conditional Formatting to a serie of cells -

D3: =B3<>""
D4: =B4<>""
D5: =B5<>""
etc

the routine i have is this:

Workbooks(sTestcase). _
Sheets("TestScripts"). _
Range("A1"). _
Offset(iRowL + 1, 3).FormatConditions.Delete
sFormat = "=" & "B" & iRowL + 1 & "<>"""""
Workbooks(sTestcase). _
Sheets("TestScripts"). _
Range("A1"). _
Offset(iRowL + 1, 3). _
FormatConditions. _
Add Type:=xlExpression, Formula1:=sFormat

the issue is, if i check on the Conditional Formating on the worksheet,
the formula is as follow:

D3: =E3<>""
D4: =E4<>""
D5: =E5<>""
etc.

as you might expect this is not the desired result - if anybody could
clarify what i am missing or where i am going wrong, this would be
mostly appreciated.

cheers...

...jurgenC!
 
Jurgen,

The problem is that the cell is being adjusted to wherever the active cell
is at the time.

Try this modified line

sFormat = "=" & "$B$" & iRowL + 1 & "<>"""""

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
hi Bob...

...thanks a million - that fixed my issue.

have a good day - jurgenC!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top