XL2BB error when range has conditional formatting

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
779
Office Version
2007
Platform
Windows
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)
 

smozgur

BatCoder
Joined
Feb 28, 2002
Messages
881
@jmacleary - Thanks for reporting the error.

Could you please let me know the conditional formatting rule in C3?

Thanks again.
 

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
779
Office Version
2007
Platform
Windows
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.
 

jmacleary

Well-known Member
Joined
Oct 5, 2015
Messages
779
Office Version
2007
Platform
Windows
Oh, and I'm using excel 2007 if that makes a difference.
 

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
34,323
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,587
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
881
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,323
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,081,726
Messages
5,360,903
Members
400,602
Latest member
newaqua

Some videos you may like

This Week's Hot Topics

  • VBA (Userform)
    Hi All, I just would like to know why my code isn't working. Here is my VBA code: [CODE=vba]Private Sub OKButton_Click() Dim i As Integer...
  • List box that changes fill color
    Hello, I have gone through so many pages trying to figure this out. I have a 2020 calendar that depending on the day needs to have a certain...
  • Remove duplicates and retain one. Cross-linked cases
    Hi all I ran out of google keywords to use and still couldn't find a reference how to achieve the results of a single count. It would be great if...
  • VBA Copy and Paste With Duplicates
    Hello All, I'm in need of some input. My VBA skills are sub-par at best. I've assembled this code from basic research and it works but is...
  • Macro
    is it possible for a macro to run if the active cell value is different to the value above it
  • IF DATE and TIME
    I currently use this to check if date has passed but i also need to set a time on it too. Is it possible? [CODE=vba]=IF(B:B>TODAY(),"Not...
Top