+ Reply to Thread
Results 1 to 6 of 6

Various Errors - program to create separate sheets for each account from data dump

  1. #1
    Registered User
    Join Date
    11-12-2015
    Location
    Washington DC
    MS-Off Ver
    2013
    Posts
    34

    Various Errors - program to create separate sheets for each account from data dump

    Hi All,

    I run a query that has 10 accounts and I'm trying to write a program that will take the original data dump and create a new worksheet, rename it for a given account # and delete all accounts except a specified one and repeat until I have a worksheet for each account and still have the results from the original query. The approach I'm taking seems to work when I started writing it for just one account but I run into problems when I add the block of code for the other account. It seems to run super quick for one but when the coding for the other accounts is added the procedure runs and runs and I have to break the script. Even when I comment all the other accounts and try to run the first account I run into different errors. Can anyone see a problem or have a recommendation for a different approach?
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Various Errors - program to create separate sheets for each account from data dump

    Where is it breaking?

    This link should help you walk through the code and such.
    http://www.cpearson.com/excel/DebuggingVBA.aspx
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

  3. #3
    Registered User
    Join Date
    11-12-2015
    Location
    Washington DC
    MS-Off Ver
    2013
    Posts
    34

    Re: Various Errors - program to create separate sheets for each account from data dump

    it is breaking at ActiveSheet.Name = "10-111595" at the beginning.

  4. #4
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: Various Errors - program to create separate sheets for each account from data dump

    Does that sheet name ALREADY exist?

  5. #5
    Registered User
    Join Date
    11-12-2015
    Location
    Washington DC
    MS-Off Ver
    2013
    Posts
    34

    Re: Various Errors - program to create separate sheets for each account from data dump

    I'm pretty sure that there wasn't already a sheet with that name. When I first got the error I looked to see if there was a sheet with that name and there wasn't and I ran it again and got the same error. I just NOW ran the proc and I didn't get the same error this time it broke at the line 4 lines below the ActiveCell.Offset(-1, 0).Select line. Weird

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,283

    Re: Various Errors - program to create separate sheets for each account from data dump

    Instead of copying the sheet over and over and deleting unwanted rows it's better to create unique list of accounts, autofilter main sheet using each element of that unique list, copy visible cells to seperate sheets and your done.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ 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. Populate 12 Sheets with data from a dynamic dump of the entire year - use a macro?
    By Nola111 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-13-2014, 09:45 AM
  2. [SOLVED] VBA Help need for Copying data from another sheet and create separate sheets
    By krjoshi in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-26-2014, 09:27 AM
  3. Using a DATA dump to create an invoice
    By Sarah Christian in forum Excel General
    Replies: 2
    Last Post: 10-08-2013, 01:15 AM
  4. How to create a simple formula for a data dump
    By blue_izce8 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 05-07-2013, 06:32 PM
  5. Replies: 1
    Last Post: 09-07-2012, 12:00 PM
  6. 1018 sheets compiled into 1 master data dump
    By ryandurick in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-02-2012, 09:32 AM

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