+ Reply to Thread
Results 1 to 4 of 4

Ensuring that VBA code runs on records in a targeted Excel Worksheet

  1. #1
    Registered User
    Join Date
    10-19-2011
    Location
    East Coast
    MS-Off Ver
    Office 365
    Posts
    33

    Ensuring that VBA code runs on records in a targeted Excel Worksheet

    Hello,

    I am running the following code (below) that is working great with one exception - if I am not specifically on the 'Webstats_RptList_RawData' tab in the active Workbook, the code will not bring in the latest records from the OneDrive folder that the target Excel files reside in it. How do I adjust the code to ensure that the 'Webstats_RptList_RawData' tab is the 'active' tab so that the code grabs the latest records from the target OneDrive folder and does not merely refresh the records already present in the 'Webstats_RptList_RawData' tab?

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Ensuring that VBA code runs on records in a targeted Excel Worksheet

    Its'clear that the code is not your own.
    If it were you would know.
    Add a line to activate the tab (worksheet) before executing.
    Ad a line like:

    Please Login or Register  to view this content.
    Of course there are more code lines and other ways but this is the simplest way if you require that tab (worksheet) to be the active one
    Last edited by Keebellah; 02-27-2019 at 12:23 PM. Reason: extra info
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    10-19-2011
    Location
    East Coast
    MS-Off Ver
    Office 365
    Posts
    33

    Re: Ensuring that VBA code runs on records in a targeted Excel Worksheet

    Yes - I gratefully stand on the shoulders of the giants who came before me. The code above looks to have done the trick and thank you!

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Ensuring that VBA code runs on records in a targeted Excel Worksheet

    You're welcome

+ 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. ensuring an amount is listed only once for duplicate records
    By accelatexcel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-28-2014, 01:46 PM
  2. [SOLVED] Code for ensuring the same data is not inputted into a column
    By Micuzzo in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-08-2013, 07:56 AM
  3. Code runs on entire workbook...need it to only run on one worksheet
    By jrobertson2403 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-28-2013, 04:50 PM
  4. [SOLVED] help on code transfered file move to targeted folder vba
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-09-2013, 06:42 AM
  5. worksheet combo box code runs when workbook open and close
    By hilander in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-29-2008, 10:25 PM
  6. Excel crashes when code runs, Please help.
    By Potoroo in forum Excel General
    Replies: 2
    Last Post: 09-12-2006, 08:39 PM
  7. [SOLVED] When code runs...worksheet acts a little strange
    By KimberlyC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-01-2005, 12:06 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