Consulting

Results 1 to 2 of 2

Thread: sorting among workbooks

  1. #1

    sorting among workbooks

    Imagine you have a column with data. And you want to spread data evenly among three workbooks. Is there a better way than cycle - copy each cell? Data doesnt need any sorting.
    My idea was something like this...
    For i = 1 to lastrow
    If y = 4 then
    Y = 1
    End if
    Copy cell i to workbook arrayOfNames(y)
    Y = Y+1
    Next i
    This is just idea...i was hoping someone had more elegant solution. Sorry for typos, im writing this message on the phone. (On the bus home).
    Thanks for any ideas.
    Last edited by DavidWaldo; 02-14-2017 at 10:22 AM.

  2. #2
    VBAX Wizard
    Joined
    Apr 2007
    Posts
    7,129
    Location
    Not sure about 'evenly', but why not copy first third to wb1, middle third to wb 2, and last third to wb 3?
    Paul

    ------------------------------------------------------------------------------------------------------------------------
    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s)
    (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •