+ Reply to Thread
Results 1 to 12 of 12

Find function doesn't work with reference and non-visible text in cell (Excel2007)

  1. #1
    Registered User
    Join Date
    12-08-2009
    Location
    Delft, The Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    10

    Question Find function doesn't work with reference and non-visible text in cell (Excel2007)

    Dear Excel users,

    I would like to use the find function, but it doesn't work properly just yet.

    My wishes are:
    * The cell that has to be found contains a reference to another cell (e.g. =L3).
    * The cell that has to be found has a width of 0,1. So the text is not visible in the cell.

    With LookIn:=xlFormulas the cell with a reference isn't found, the cell with the original value is found also with a width of the cell of 0,1.

    With LookIn:=xlValues both cells are found, but none of the cells are found when the width is 0,1.

    A concised example is attached. The macro is given in the following quote.

    Please Login or Register  to view this content.
    Hopefully someone has a suggestion?

    Thanks! Wiggert
    Attached Files Attached Files
    Last edited by teylyn; 12-22-2009 at 08:55 PM. Reason: changed quote to code tags

  2. #2
    Forum Contributor
    Join Date
    12-02-2009
    Location
    Akron, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    208

    Re: Find function doesn't work with reference and non-visible text in cell (Excel2007

    Since you're using code anyways why not just expand the column(s) and then put them back to the width you want. You can turn off the screen updating so the user can't see what's going on.

  3. #3
    Registered User
    Join Date
    12-08-2009
    Location
    Delft, The Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    10

    Question Re: Find function doesn't work with reference and non-visible text in cell (Excel2007

    Dear jrdnoland,

    Since you're using code anyways why not just expand the column(s) and then put them back to the width you want. You can turn off the screen updating so the user can't see what's going on.
    Maybe that will be the best and only solution there is, because I still haven't found a clue to get the job done otherwise.

    Thanks for the reply and the idea!

    Maybe someone else has the master solution??

    Cheers, Wiggert

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Find function doesn't work with reference and non-visible text in cell (Excel2007

    Hello Wiggert,

    Try this...
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Registered User
    Join Date
    12-08-2009
    Location
    Delft, The Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Find function doesn't work with reference and non-visible text in cell (Excel2007

    Hello Leith,

    Thanks for the reply!

    I'm getting a compile error: Unvalid qualification.

    What would be the purpose of the "*" code?

    Also:
    Dim findCell As string
    findCell = Range("B3").text

    gives the same error.

    And:
    CDate("*" & findCell & "*") gives the error in dutch; typen komen niet overeen. The translation would be something as The types don't match.

    Hope you know what the problem is? because I do not..

    Thanks! Wiggert

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Find function doesn't work with reference and non-visible text in cell (Excel2007

    Hello Wiggert,

    The asterisk is used as a "wildcard" character in the Find function. It means match zero or more characters.

    This piece of code:
    Please Login or Register  to view this content.
    retrieves the cell text, the formatted part that you see on the worksheet.

    This line
    Please Login or Register  to view this content.
    is generating error because I used the wrong syntax. The wildcard characters are not legal date characters. Change it to this...
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-08-2009
    Location
    Delft, The Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Find function doesn't work with reference and non-visible text in cell (Excel2007

    Hello Leith,

    Thanks for the thorough explanation.

    It still isn't working. I used this code:

    Please Login or Register  to view this content.
    I'm getting the error that the objectvariable or blockvariable With isn't given.
    This ussualy implies that the find function hasn't found anything, right?

    It is a logic reaction I think, because findCell is now a value (e.g. 38765) and the cells in the sheet only contain date formatted values.

    Also when I use findcell as a string:

    Please Login or Register  to view this content.
    The macro also returns the error objectvariable or ... etc. isn't found, allthough findCell has the 'value' "1-1-2009". So why doesn't it find a value in the sheet without cDate then?

    Any suggestions?

    Thanks again! Wiggert

  8. #8
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Find function doesn't work with reference and non-visible text in cell (Excel2007

    Hello Wiggert,

    It would easier for me to troubleshoot the problem using the original data. Can you post your workbook? I am using Excel 2003.

  9. #9
    Registered User
    Join Date
    12-08-2009
    Location
    Delft, The Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Find function doesn't work with reference and non-visible text in cell (Excel2007

    Hi Leith,

    Isn't that the .xlsm file I attached in my first post? Can you open that file with excel 2003?

    That file hasn't changed since then.

    I also attached a .xls file.

    Thanks for the effort!

    Wiggert
    Attached Files Attached Files

  10. #10
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Find function doesn't work with reference and non-visible text in cell (Excel2007

    Hello Wiggert,

    Excel 2003 can read 2007 files with some upgrades, but I haven't gotten them yet. The xls file I can read. Thanks for posting it.

  11. #11
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Find function doesn't work with reference and non-visible text in cell (Excel2007

    Hello Wiggert,

    Here is what I have found. The Find function will miss cells if the data can not be displayed in full. Both xlFormulas and xlValues settings are affected the same way. So, I need to develop a "Plan B" using VBA to locate thiese cells in a fast and efficient manner, regardless of the cell size or if they are not visible.

  12. #12
    Registered User
    Join Date
    12-08-2009
    Location
    Delft, The Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Find function doesn't work with reference and non-visible text in cell (Excel2007

    Exactly!

    And I was hoping there would be a simple solution for this.

    I'm hoping you'll come up with a great solution!

    Merry Christmas everybody!

    Wiggert

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1