Results 1 to 23 of 23

how to tell if a table exists in a worksheet

Threaded View

  1. #19
    Valued Forum Contributor dmcgov's Avatar
    Join Date
    11-11-2015
    Location
    Florida, USA
    MS-Off Ver
    Office 365 Business
    Posts
    1,518

    Re: how to tell if a table exists in a worksheet

    so i put the following code in my "Closed POs" sheet.

    [CODE]
    Private Sub Worksheet_Change(ByVal Target As Range)

    Dim KeyCells As Range

    Dim FullExcelPath As String

    FullExcelPath = ThisWorkbook.FullName
    'MsgBox FullExcelPath

    Application.DisplayAlerts = False

    ' The variable KeyCells contains the cells that will
    ' cause an alert when they are changed.
    Set KeyCells = Range("d:d")

    If Not Application.Intersect(KeyCells, Range(Target.Address)) _
    Is Nothing Then
    Select Case Target.Value
    Case Is < Now - 30
    MsgBox "Move to Closed PO archive file"
    Case Is >= Now - 30
    MsgBox "Keep for now"
    Case Else
    MsgBox "Case Else"
    End Select
    End If
    End Sub
    /CODE]

    so the stub works as expected, when i change dates it goes through the case statement properly. but what i really want is for this to be a OPEN worksheet event as well. it should check the Aging date in column D and see if its a month old or older.

    i figure this should be a worksheet event but im not sure of how to transfer the code in the stub to the ThisWorkbook code sheet.

    thoughts?
    Last edited by dmcgov; 08-23-2017 at 08:44 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Can't name a table as the name exists, but it does not!?
    By brucemc777 in forum Excel General
    Replies: 0
    Last Post: 11-04-2015, 08:05 PM
  2. [SOLVED] If Worksheet Exists
    By ChrisMattock in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-17-2015, 11:16 AM
  3. Check if Worksheet exists and Insert Worksheet
    By ddanmcgrew in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-27-2012, 03:19 PM
  4. Replies: 6
    Last Post: 08-04-2011, 12:18 PM
  5. worksheet exists or not
    By skvabbili in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-04-2006, 05:50 PM
  6. [SOLVED] Worksheet exists
    By Kaval in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2006, 04:55 AM
  7. [SOLVED] check if worksheet exists
    By joeeng in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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