+ Reply to Thread
Results 1 to 7 of 7

Selecting only visible cells

  1. #1
    Registered User
    Join Date
    09-17-2015
    Location
    Portland, OR
    MS-Off Ver
    2010
    Posts
    8

    Selecting only visible cells

    Hello, I have a sheet and column A has about 64000 cells with values.

    When I sort, I need to develop a code that adds a 'checkbox' but only on the items visible to the user. I have created/mashed some code together that does this; however, it appears it wants to start @ A1 and go through the entire list. The result is the items that are visible & have nothing in the cell located in columns C, get a cell while the others do not. The problem is that it's taking a long time to do this and I figure there has to be a means to only work with the visible cells...not all. There just be a way.

    My question is what or how to I set the 'lastrow' only to see the visible cells? If there are recommendations please share.

    Thanks....b




    Please Login or Register  to view this content.
    Last edited by blegate; 10-14-2015 at 04:32 PM.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Selecting only visible cells

    Unfortunately 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



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    10-10-2015
    Location
    Hoboken, Antwerp, Belgium
    MS-Off Ver
    2010
    Posts
    93

    Re: Selecting only visible cells

    Hi,

    Your code for getting the last row of a column has an error in it.

    Your code:
    Please Login or Register  to view this content.
    Must be:
    Please Login or Register  to view this content.
    Or you can use this instead:
    Please Login or Register  to view this content.
    Greetings,

    Cheetahke

  4. #4
    Registered User
    Join Date
    09-17-2015
    Location
    Portland, OR
    MS-Off Ver
    2010
    Posts
    8

    Re: Selecting only visible cells

    I guess I'm not following OR perhaps I'm going down the wrong path.

    Scenario, I have 64K items in Column A. I currently have 10 cells visible by filtering...lets says rows 35000 through 35010.
    I'd like to figure out how I can attached a checkbox to those 10 cells but not have excel start analyzing @ A1 but rather @ row 35000
    I'm in the process of 'relearning' a lot of vba so thanks for your patience.

    b

  5. #5
    Registered User
    Join Date
    10-10-2015
    Location
    Hoboken, Antwerp, Belgium
    MS-Off Ver
    2010
    Posts
    93

    Re: Selecting only visible cells

    Perhaps you can try this...

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    09-17-2015
    Location
    Portland, OR
    MS-Off Ver
    2010
    Posts
    8

    Re: Selecting only visible cells

    I cannot post my new code to save my life here. I keep on getting A sQL injection error even though I properly format the code. ideas?
    Brian

  7. #7
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: Selecting only visible cells

    Has happened to me multiple times as well, can be rather frustrating. Try separating the words that seems to trigger SQL injection error, or upload a workbook sample with the code.

+ 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] Only selecting visible cells in a table with hidden rows
    By pfeifferjoey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-02-2014, 09:22 AM
  2. Selecting 2nd to last Visible row in a filtered list
    By PSBuskey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2013, 04:43 PM
  3. [SOLVED] Copy/Pasting Values from visible cells (using autofilter) to visible cells
    By evakotsi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2012, 07:49 AM
  4. Copy Visible cells and paste values only to visible target cells
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-28-2010, 04:09 AM
  5. selecting visible rows
    By sexgod in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 04-14-2007, 04:26 PM
  6. Selecting Column of Visible AutoFiltered Cells.
    By Robert Christie in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-12-2005, 08:06 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