+ Reply to Thread
Results 1 to 13 of 13

SpecialCells(xlCellTypeVisible)

  1. #1
    Registered User
    Join Date
    07-31-2016
    Location
    Holland
    MS-Off Ver
    2019
    Posts
    74

    SpecialCells(xlCellTypeVisible)

    Please Login or Register  to view this content.
    Last edited by Wijnand1; 10-18-2016 at 03:02 AM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: SpecialCells(xlCellTypeVisible)

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here
    (I have added them for you - this time )
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    07-31-2016
    Location
    Holland
    MS-Off Ver
    2019
    Posts
    74

    Re: SpecialCells(xlCellTypeVisible)

    oke, many thanks! will do with my next post.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: SpecialCells(xlCellTypeVisible)

    Is the code not working?

    When/where are you filtering?
    If posting code please use code tags, see here.

  5. #5
    Registered User
    Join Date
    07-31-2016
    Location
    Holland
    MS-Off Ver
    2019
    Posts
    74

    Re: SpecialCells(xlCellTypeVisible)

    i have a button in the userform that will autofilter the excel sheet. When i use the above code to search the excel sheet and display the results in the listbox, only the visible cells need to be displayed in the listbox, not the cells that a hide by the autofilter.

  6. #6
    Registered User
    Join Date
    07-31-2016
    Location
    Holland
    MS-Off Ver
    2019
    Posts
    74

    Re: SpecialCells(xlCellTypeVisible)

    Hope someone can help? if more information is needed...

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: SpecialCells(xlCellTypeVisible)

    Why are you filtering and checking column B for the value in txtSearch?

    That's what's confusing me.

  8. #8
    Registered User
    Join Date
    07-31-2016
    Location
    Holland
    MS-Off Ver
    2019
    Posts
    74

    Re: SpecialCells(xlCellTypeVisible)

    The above code is to search the value in "txtSearch.Value" when value in "cboSelect.Value" is Service number and show the results in the listbox. This is working. But when i aply the autofilter in excel it only needs to search and show the visible cells in the listbox and not the cells that are hide by the autofilter.
    Last edited by Wijnand1; 10-19-2016 at 02:53 AM.

  9. #9
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: SpecialCells(xlCellTypeVisible)

    With this loop,
    Please Login or Register  to view this content.
    you will be looping through all cells.

    You need to change the loop to only loop through visible cells.

    That can be done with something like this, which loops through the visible cells in column B.
    Please Login or Register  to view this content.
    That's pretty rough, and untested, but hopefully you get the idea.

  10. #10
    Registered User
    Join Date
    07-31-2016
    Location
    Holland
    MS-Off Ver
    2019
    Posts
    74

    Re: SpecialCells(xlCellTypeVisible)

    Thanks for the information. I get the idea but do not get it to work.

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: SpecialCells(xlCellTypeVisible)

    How does it not work?

    Any chance you could upload a sample workbook?

    Click on GO ADVANCED, scroll down and click Manage Attachments.

  12. #12
    Registered User
    Join Date
    07-31-2016
    Location
    Holland
    MS-Off Ver
    2019
    Posts
    74

    Re: SpecialCells(xlCellTypeVisible)

    Got it to work, thanks Nory!! Looping takes a "long" time if the row it big. Is there another way to get te results?

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: SpecialCells(xlCellTypeVisible)

    What code did you end up with?

    How much data do you have and how are you filtering it?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Resize Range & Specialcells (xlCellTypeVisible)
    By BuZZarD73 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-14-2015, 03:46 AM
  2. [SOLVED] iterate through SpecialCells(xlCellTypeVisible) Row#, Range.Address
    By dlow in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-05-2015, 03:13 AM
  3. VBA Range.SpecialCells( xlCellTypeVisible ) not working as a UDF
    By dwk49 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-29-2012, 05:29 AM
  4. Resize Range SpecialCells xlCellTypeVisible
    By goss in forum Excel General
    Replies: 1
    Last Post: 07-13-2012, 02:13 PM
  5. Count only SpecialCells(xlCellTypeVisible) with a certain .Value
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-21-2012, 10:19 PM
  6. Cut & Paste - AutoFilter SpecialCells(xlCellTypeVisible)
    By SunOffice in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-19-2011, 05:28 PM
  7. specialcells(xlcelltypevisible): same code, different results?
    By dreamz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-12-2006, 12:12 PM

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