+ Reply to Thread
Results 1 to 3 of 3

VBA to test if column is on screen.

  1. #1
    Registered User
    Join Date
    10-21-2023
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    22

    VBA to test if column is on screen.

    I’m looking for a way to determine if a column is visible on screen (i.e., not just visible but on screen). I have this working for a cell but I’d rather it be any cell in a column not just on specific cell. Here’s what works for the cell. Maybe there’s some easier way.

    Function CellIsInVisibleRange(cell As Range)
    CellIsInVisibleRange = Not Intersect(ActiveWindow.VisibleRange, cell) Is Nothing
    End Function


    If CellIsInVisibleRange(ActiveSheet.Range("M4")) Then
    MsgBox "Cell is visible"
    Else
    MsgBox "Cell is NOT visible"
    End If


    Thanks,
    Steve

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,232

    Re: VBA to test if column is on screen.

    Try changing the condition to:
    Please Login or Register  to view this content.
    Artik

  3. #3
    Registered User
    Join Date
    10-21-2023
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    22

    Re: VBA to test if column is on screen.

    Excellent, thank you Artik, that worked perfectly.

    Much appreciated,
    Steve

+ 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. vbe tool bar moved to left side of screen. Can't change it back to the top of screen
    By whburling in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-16-2023, 07:20 PM
  2. Test for Start screen
    By lb_33 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-20-2022, 07:55 AM
  3. Replies: 2
    Last Post: 11-16-2016, 11:40 AM
  4. [SOLVED] Lookup column for certain values, then test against second column if > 800
    By Steve_1009 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 08-27-2016, 03:24 AM
  5. Macro which captures screen prints of the screen when the sheet is completely minimized
    By dimple.pal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-14-2016, 05:42 PM
  6. Pull sub-test scores from test w/best overall test score (PSAT)
    By PowerSchoolDude in forum Excel General
    Replies: 0
    Last Post: 11-19-2009, 08:29 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