+ Reply to Thread
Results 1 to 3 of 3

Specifying a specific sheet in a "FindString" command

  1. #1
    Registered User
    Join Date
    01-05-2016
    Location
    Southampton
    MS-Off Ver
    Excel 2013
    Posts
    40

    Specifying a specific sheet in a "FindString" command

    I have the following VBA code to retrieve data from hundred of spreadsheets. The data is located in sheet 1, named "Sheet1". A new sheet has been added to all the spreadsheets (not relevant to the data this macro retrieves) but each spreadsheet has been saved whilst the new sheet is active, so the command is looking in this sheet for the data "Total Purchased" rather than Sheet1 which was always the default active sheet. How can I amend my code to look in the correct sheet?

    I hope this is clear! Thank you

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Specifying a specific sheet in a "FindString" command

    Something like this:

    Please Login or Register  to view this content.
    and then all your Ranges refering to that sheet inside that with statement need to look like:

    Please Login or Register  to view this content.
    etc. etc.
    I'm interested in starting a career working with VBA, if anyone knows of any opportunities!

  3. #3
    Registered User
    Join Date
    01-05-2016
    Location
    Southampton
    MS-Off Ver
    Excel 2013
    Posts
    40

    Re: Specifying a specific sheet in a "FindString" command

    Hi, I dont understand? Do I just add the line "Set ws1 = wb1.Sheets("Total Purchased")" into the macro after "wb1.Activate"??

    Apologies, I didnt write this code and am a complete VBA novice..

+ 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] :confused: Auto pick "specific data" and put it in "specific cells" with date
    By pipsmultan in forum Excel Formulas & Functions
    Replies: 29
    Last Post: 08-27-2014, 03:31 AM
  2. Auto Pick Only "Specific Day & Date" & put in "specific cells" Vertically
    By pipsmultan in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-25-2014, 01:24 AM
  3. Need help creating specific "add-row" macro using a command button
    By rmtreadw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-28-2014, 10:01 PM
  4. Replies: 3
    Last Post: 05-31-2013, 05:16 AM
  5. Create a Command Button to "Save As" and "Close" an Excel Workbook
    By thedunna in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-26-2013, 05:38 PM
  6. How to change a Command Button caption from "Enable" to "Disable"?
    By Infinity in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2007, 12:14 AM
  7. inserting a conditional "go to" command on a excel "if" function
    By velasques in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-10-2006, 04:20 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