+ Reply to Thread
Results 1 to 6 of 6

Macro for Excel - Help Needed

  1. #1
    Registered User
    Join Date
    01-14-2012
    Location
    Unites States
    MS-Off Ver
    Excel 2003
    Posts
    2

    Post Macro for Excel - Help Needed

    Please Login or Register  to view this content.
    Here's what I have so far. Ideally I want it to do the following things:

    -Save the Range("A1:B50"), then Range("A51:B100"), then Range("A101:B150") and so on.

    - I want each of them to save as an individual .CSV file, with the file names increasing in integers of 1.

    Any Excel Macro wizards out there? I would love some help with this, thanks.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Macro for Excel - Help Needed

    I create a macro based on your criteria. The macro will first look the last row of column A, and decide how many csv files to produce. For instance, if there is 300 items, then the macro will produce 6 files (300/50 = 6)

    Look at the sample file and see if that is what you're looking for. You might need to change the directory url.

    Here is the code if anyone is interested.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro for Excel - Help Needed

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then amend your thread title accordingly.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  4. #4
    Registered User
    Join Date
    01-14-2012
    Location
    Unites States
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Macro for Excel - Help Needed

    Quote Originally Posted by JieJenn View Post
    I create a macro based on your criteria. The macro will first look the last row of column A, and decide how many csv files to produce. For instance, if there is 300 items, then the macro will produce 6 files (300/50 = 6)

    Look at the sample file and see if that is what you're looking for. You might need to change the directory url.

    Here is the code if anyone is interested.

    Please Login or Register  to view this content.


    It works in the sense that it creates 6 csvs, but they all contain the 300 original rows. I need it to take 50 and separate it basically.

  5. #5
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Macro for Excel - Help Needed

    It is actually more complicated than I thought. Took me awhile to come up with an inefficient solution. Same file, but try this code.

    Please Login or Register  to view this content.
    Last edited by JieJenn; 01-14-2012 at 02:58 AM.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Macro for Excel - Help Needed

    Your post does not comply with Rule 7 of our Forum RULES. Please do not ignore Moderators' or Administrators' requests - note that this includes requests by senior members as well, if you are unclear about their request or instruction then send a private message to them asking for help. Do not post a reply to a thread where a moderator has requested an action that has not been complied with e.g Title change or Code tags...etc
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

+ 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