+ Reply to Thread
Results 1 to 4 of 4

Sealecting rows by value and copying to new sheet

  1. #1
    Registered User
    Join Date
    04-13-2008
    Posts
    2

    Sealecting rows by value and copying to new sheet

    I'm trying to select entire rows of data based on specific values in a column and then paste those rows to a new worksheet.

    This code below loops 10 times and creates 10 new sheets. Any chance someone could explain some of the code to me and help me adapt it to suit my situation?:

    Data will be in sheet 1 ("Data List"). I want search down the rows and if the value in column 2 is "1" copy that row to the sheet named "Heat 1", if the value is "2" then copy that row intt the sheet "Heat 2", etc.

    Please Login or Register  to view this content.
    Any help would be much appreciated.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606
    Cross-post: http://www.ozgrid.com/forum/showthre...169#post429169

  3. #3
    Registered User
    Join Date
    05-02-2006
    Posts
    80
    Hi,

    Ended up rewriting code rather than go through what was already there.

    Please Login or Register  to view this content.
    This will work it's way down column B and copy the contents of the entire row to a new sheet called "Heat_x" depending on the value in column B.
    I advise you make sure only the Worksheet "Data List" is present befroe running it (i.e. delete Sheets 2 and 3 if present).
    Is this doing pretty much what you require? If you need anything more post back.

    Note - This could also be handy whilst you're testing this----
    If you want to get back to just having your data list sheet after having generated 100+ sheets that you don't want (happened to my whilst developing this ) then use the following code to do it quickly (though ensure Data List is worksheet 1!!)

    Please Login or Register  to view this content.

    Tris

  4. #4
    Registered User
    Join Date
    04-13-2008
    Posts
    2
    Hi Tristan,

    Thanks very much for your help, for taking the time to write the code and for the offer of more help if needed. My school project is due at the end of the week and I'm almost there with it but just been a bit stuck.

    On adding the code and running it an error comes up about the final "paste" in the code being incorrect but I'm not sure why.

    I didn't explain in my first post but the program starts by opening a new visual basic applciation, workbook and sheets etc. The program runs from one excel document and creates another. I don't know if this has anything to do wth the location it is trying to paste in. In other parts of the code I've had to be specific about which sheet I'm using eg oWB.worksheets(..... instead of just worksheets(......


    It may be easier if I paste you my program so far
    Please Login or Register  to view this content.

    Any ideas?

    I wouldn't usually ask for so much help with this, its just I've got a really tight deadline and still have the report to write as well with teachers puting pressure on me.

    Thanks again

    cleaco

+ Reply to Thread

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