Results 1 to 6 of 6

define vba for only one workbook

Threaded View

  1. #1
    Registered User
    Join Date
    08-02-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    3

    define vba for only one workbook

    Hi (BIG NEWBIE!!)

    Wrote a code as per below, but it runs in all active workbooks.

    How can I define the code that it only runs for a specific workbook?

    Thank You

    Sub AutoUpdate()
    dTime = Now + TimeValue("00:01:00")
    Application.OnTime dTime, "AutoUpdate"
    Run "LiveRefresh"
    End Sub
    Private Function GetValue(path, file, sheet, ref)
    path = "H:\ATM_Solutions\Cashing\Gary\Lesley\test"
    file = "CIT Dashboard - CIT Unavailable Incidents.xlsx"
    sheet = "Page1_1"
    ref = "$A$:$n$"
    End Function
    Sub LiveRefresh()
    '
    ' LiveRefresh Macro
    '
    
    '
        ActiveWorkbook.RefreshAll
    End Sub
    Last edited by arlu1201; 08-02-2012 at 05:04 AM.

Thread Information

Users Browsing this Thread

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

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