+ Reply to Thread
Results 1 to 4 of 4

VBA Looping Query

  1. #1
    Registered User
    Join Date
    12-23-2010
    Location
    california
    MS-Off Ver
    Excel 2003
    Posts
    2

    Question VBA Looping Query

    Hi:
    I have a worksheet with about 4000 entries in a single column. I would like to write a script that loops through the entries, captures a selection of them and enters the selection into a new worksheet.

    Here is an example:

    Starting from the top, I want to loop through and capture all the entries from '#perfom' to the next entry that starts with a '#'. i would also like to name the worksheet with the word after the # symbol.

    # perfom
    name
    name
    name
    name
    # perfap
    name
    name
    name
    name


    Does that make sense? If anyone can help me write this I would appreciate it. I have very little programming experience so I apologize in advance.

    Thanks

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: VBA Looping Query

    see attachment
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    12-23-2010
    Location
    california
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: VBA Looping Query

    Quote Originally Posted by watersev View Post
    see attachment

    Thanks alot for the reply. I think this is close to what I need. Basically I would be looking for the following output:

    Sheet Name:
    Perfap
    Content:
    # perfap
    name
    name
    name
    name

    Sheet 1 Name: Perfap
    Content:
    # perfap
    name
    name
    name
    name

    Does that make sense? So I want to capture all the data between the #perfap and post that to separate sheets.

    Thanks!

  4. #4
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: VBA Looping Query

    see attachment

    I assume the name of the newly created sheets will be unique otherwise the code will stop
    Attached Files Attached Files
    Last edited by watersev; 12-24-2010 at 01:59 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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