+ Reply to Thread
Results 1 to 8 of 8

Reach end of worksheet, continue on a new one

  1. #1
    Registered User
    Join Date
    01-10-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    51

    Reach end of worksheet, continue on a new one

    Hey guys,
    I have a file that uses every column in a worksheet and fills it with data. How could I make my macro simply continue this on a new worksheet? I feel like I'm making it a lot harder than it needs to be. Basically, I need this portion of my code to work until it fills a sheet, then have it create a new one and keep recording there, including the correct dates and headings.

    Please Login or Register  to view this content.
    I can't always post examples of what I might be asking about due to confidentiality issues, but I WILL try to explain my problems as thoroughly as I can.

  2. #2
    Registered User
    Join Date
    01-10-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    51

    Re: Reach end of worksheet, continue on a new one

    bump? mods, sorry for the double post, just really need help.

  3. #3
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: Reach end of worksheet, continue on a new one

    You got quite a lot going on there. It is hard to see what is happening but in response to your question would it be possible to use a For/Next loop outside whichever section is actually putting the data on the sheets? Something like:
    Please Login or Register  to view this content.
    Not sure if this is gonna help you any but who knows, it might.

  4. #4
    Registered User
    Join Date
    01-10-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    51

    Re: Reach end of worksheet, continue on a new one

    I thought of that, but that's the problem. I feel like anything that is going to be done has to be within this for each loop. I know it has a lot going on, and its most likely very sloppy code because I'm learning as I'm writing (thanks to this forum) but I've been trying things left and right that just don't want to work.

  5. #5
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Reach end of worksheet, continue on a new one

    Can you code it using some conditional formatting so that it sees when column IV is not blank and immediately fires a macro to create a new worksheet and copy all of your column headings over to the new sheet?
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  6. #6
    Registered User
    Join Date
    01-10-2011
    Location
    Boston, MA
    MS-Off Ver
    Excel 2003
    Posts
    51

    Re: Reach end of worksheet, continue on a new one

    Quote Originally Posted by jwright650 View Post
    Can you code it using some conditional formatting so that it sees when column IV is not blank and immediately fires a macro to create a new worksheet and copy all of your column headings over to the new sheet?
    thats an awesome idea.I'll try it and let you know how it works. The only thing flawed about it is, the headings are all different, I'm continuing to count device names and putting them in every 2 headers. I think I can work something out with the conditional formatting though.

  7. #7
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Reach end of worksheet, continue on a new one

    I think that I mis-spoke about using conditional formatting....maybe use the "ISBLANK" function and

    IF it returns "FALSE", then
    fire the macro.......

    ElesIf it returns "TRUE",
    then "Exit Sub"
    End IF

  8. #8
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Reach end of worksheet, continue on a new one

    Might better to use a COUNTA worksheet function in your code. ISBLANK can only check one cell I think.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

+ 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