+ Reply to Thread
Results 1 to 2 of 2

To apply the macro only on the visible cell (filtered data alone)

  1. #1
    Registered User
    Join Date
    09-13-2021
    Location
    India
    MS-Off Ver
    365
    Posts
    36

    To apply the macro only on the visible cell (filtered data alone)

    Hello everyone,

    I got the below code from this forum only, unable to post the link. Due to the warning message "You are not allowed to post any kinds of links, images or videos until you post a few times."

    Please Login or Register  to view this content.

    The above macro highlights the first occurrence of the word in red font (in column D alone). (Data is found in column D11 to E15000. Range D10 & E10 contains the header). Currently the macro takes the whole data set while highlighting, even when the filter is on and only 15 rows are visible.

    Is it possible to find last row of visible cells alone (minus the header) and incorporate into the code. I want the macro to take only the visible cells into consideration while highlighting for first occurrence word. Can anybody please help ?. When i tried to include "SpecialCells(xlCellTypeVisible)", I am always getting an error. "Run time error 13, type mismatch. Please help.
    Attached Files Attached Files
    Last edited by Lona; 09-24-2021 at 04:09 AM.

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: To apply the macro only on the visible cell (filtered data alone)

    I would have thought you would just replace your y/x loops with a basic range iteration, along lines of below (only modified existing code where relevant):

    Please Login or Register  to view this content.

+ 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] Apply cell numbering to visible rows only
    By Groovicles in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-24-2017, 11:44 AM
  2. [SOLVED] Apply Macro to Filtered List
    By YOO629 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-03-2015, 05:10 PM
  3. Offset to next visible cell in filtered data
    By Varun13 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2013, 04:37 AM
  4. [SOLVED] Macro to select visible rows containg data in filtered list
    By knevil in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-15-2013, 01:22 PM
  5. [SOLVED] Macro: Copy text values of Visible cells (on a FILTERED data)
    By rampal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-24-2013, 06:12 AM
  6. Error checking of visible filtered data - Display text in textbox if no data visible
    By cocobean in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-06-2012, 12:58 AM
  7. Macro to select till last cell visible(numbers in cells) (filtered) ignoring formulas
    By DiegoBoffa in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-08-2012, 11:10 PM

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