+ Reply to Thread
Results 1 to 5 of 5

Skip sheets and check for txt in a cell.

  1. #1
    Forum Contributor
    Join Date
    02-13-2017
    Location
    Durham
    MS-Off Ver
    2013
    Posts
    126

    Skip sheets and check for txt in a cell.

    Hi All,

    I have a doc which for example purposes has Sheets 1-4. I want to 'skip' sheets 1-3 and then do a check for txt in sheet 4. If there IS txt then I'd like to call a sub which copies a column, if not then stop working.
    Also, If there is the specified txt and I call the sub to copy the column, I would then like to continue the loop to check for this txt on the next sheet etc.

    The reason being is I have a template where sheets 1-3 are always named the same. Whereas the 4th onwards will have different names in each document however will hold the same data.

    I have the following:

    Please Login or Register  to view this content.
    I'm struggling a bit so any guidance would be great!

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Skip sheets and check for txt in a cell.

    Would it not be
    next ws

    Here is my take on this,

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-13-2017
    Location
    Durham
    MS-Off Ver
    2013
    Posts
    126

    Re: Skip sheets and check for txt in a cell.

    Hi Dave,

    Firstly, love the way you arrow your code....makes it look very neat.

    In regards to the next ws, yeah I've put 'next sheet?' as an indicator to query if this is where the next WS bit goes. Your code seems to do the job in regards to searching, finding and then my sub captures the data. I now just need to state If Not InStr Then end sub etc

    Thanks for your help

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,483

    Re: Skip sheets and check for txt in a cell.

    There are lots of different options what are you trying to do?

    For example: This will change the msgbox it the word "Potato" is not found.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    02-13-2017
    Location
    Durham
    MS-Off Ver
    2013
    Posts
    126

    Re: Skip sheets and check for txt in a cell.

    Hi Dave,

    Sorry for the late reply.

    The end goal is to search for a title (As this does) then if found copy everything under it into and array.

    Again thanks for your help.

+ 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. Auto fill cell in different sheets, based on a check box.
    By ben83 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-25-2016, 04:09 PM
  2. Replies: 2
    Last Post: 03-04-2015, 02:48 PM
  3. [SOLVED] Check read-only status, and if locked - skip all code and give a message box
    By jedemeyer1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-08-2014, 01:32 AM
  4. [SOLVED] VBA - How to check for certain string in cell and paste into other between sheets
    By UsmanBPD in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-10-2012, 12:58 PM
  5. Check if a cell is populated, if not, skip, but do nothing.
    By Darth269 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-12-2012, 05:42 PM
  6. check the cell and skip the copy
    By venkatatcts in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-09-2009, 09:42 AM
  7. [SOLVED] Sheets Skip Macro
    By NICK in forum Excel General
    Replies: 2
    Last Post: 02-11-2005, 04:06 AM

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