XL2BB error when range has conditional formatting

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
711
I was trying to use XL2BB to answer a thread on here and my selected range contained conditional formatting. When I used the tool I got an error (see pic 2). If I didn't check the conditional formatting box, it generated the data fine.

xl2bb1.PNG
xl2bb2.PNG


The generated data (without conditional formatting selected):

xl2bb.xlam
ABC
212/12/20191
313/02/20196
Sheet1
Cell Formulas
Range(s)Formula
C2:C3C2=EDATE(A2,B2)
 

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
711
Hello. It is a rule applied to the whole column, as follows:
Code:
=AND($C1>0,$C1<TODAY())
and the format applied is a background fill of amber.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,148
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
Oh, and I'm using excel 2007 if that makes a difference.
It will if the code in XL2BB uses the DisplayFormat property as that didn't exist in 2007.
 

Scott T

Well-known Member
Joined
Dec 14, 2016
Messages
2,556
Office Version
365, 2016
Platform
Windows
It will if the code in XL2BB uses the DisplayFormat property as that didn't exist in 2007.
That does look like the problem as I used CF in 2016 and it works

xl2bb.xlam
ABC
1
212/12/20191
32/13/20196
Sheet3
Cell Formulas
Range(s)Formula
C2:C3C2=EDATE(A2,B2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C2:C3Expression=C2<>""textNO
 

smozgur

BatCoder
Joined
Feb 28, 2002
Messages
880
It will if the code in XL2BB uses the DisplayFormat property as that didn't exist in 2007.
Interesting, the add-in supposed to not fail since it is checking Excel version and simply ignoring the displayed format if the function is not supported. However, it looks to be failing somehow.

Added this into the list, and I'll be checking for the upcoming update.

Thanks again.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,148
Office Version
365, 2019, 2016, 2010
Platform
Windows, MacOS
You could use conditional compilation #If VBA7 then, assuming this is actually the issue (though I’d expect a 438 error rather than 1004).
 

Forum statistics

Threads
1,077,829
Messages
5,336,647
Members
399,094
Latest member
Learner2019

Some videos you may like

This Week's Hot Topics

Top