• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Blank cells with values?

tazz

Member
Hello all,
I have this sheet with 2 macro: one that will extract data from an acad file and the other one that fills empty cells in col BA.Both of them were working fine until I descovered that the data extractor thinks that data like 5-3303 is May-03 (as shown in sheet"before modifications").
I inserted this code line:"excelSheet.Range("BA2:BA100").NumberFormat="@" and data
is extracted corect but the macro that will fill empty cells is not working anymore(as shown in sheet"after modifications").
I tried many thing to fix this but is seems that nothing will make the macro that fills empty cells to work.
Thank you for your help
PS: in my opinion macro that Fills empty cells acts like those empty cells are in fact not empty
 

Attachments

  • Fill data test.xlsm
    52.2 KB · Views: 7
Hi, tazz!

Since 5-3303 is a valid date for 01/May/3303 it's correct your solution of changing cell format. What I can't easily test as I don't have the AutoCad file is:
but the macro that will fill empty cells is not working anymore(as shown in sheet"after modifications")

I checked the procedure FillEmptyCells in module FillEmptyCell and it works fine on 1st worksheet (before) but not on 2nd one (after). So I suppose that the problem might be within the procedure ExtractAtt in module extractAttributes, but I have to deal with the post execution version. However I think that you could debug it and check what happen in this part of the code:
Code:
                    RowNum = RowNum + 1
                    For Count = LBound(Array1) To UBound(Array1)
                        excelSheet.Cells(RowNum, Count + 53).Value = Array1(Count).TextString
                    Next Count
specifically with the content of Array1, to check if it's assigning null strings to cells BA2:BA7 (from BA8 in advance it has data so no problem there).If you happen to find that there is the problem I'd give a try to this:
Code:
                    RowNum = RowNum + 1
                    For Count = LBound(Array1) To UBound(Array1)
                        If Array1(Count).TextString <> "" Then _
                            excelSheet.Cells(RowNum, Count + 53).Value = Array1(Count).TextString
                    Next Count

Just advise if any issue.

Regards!
 
You've discovered the joys of the zero-length null string. :( Very annoying problem.
Similar to my colleague SirJB7's suggestion, I'd suggest checking the incoming value before putting it in the cell. Not sure if it's in the section he posted, or should be in this part
Code:
If Array1(Count).TagString <> "" Then excelSheet.Cells(RowNum, Count + 1).Value = Array1(Count).TagString[code]
 
@Luke M
Hi, buddy!

Why might it be that I feel concerned and perturbed each time you agree with me? Am I doing things so wrong? :p

But I agree with you, in this case it's a kinda binding time, either early as in your suggestion or later in mine.

Regards!

PS: Don't feel neither concerned nor perturbed, please! I'd hate not being able to get to sleep at nights. :rolleyes:
 
Hello,
I made the suggested changes and is working really nice.
Thank you to both of you.
 
Hi, tazz!
Glad you solved it. Thanks for your feedback and for your kind words too. And welcome back whenever needed or wanted.
Regards!
 
Back
Top