+ Reply to Thread
Results 1 to 3 of 3

Macro help - Copy cells among several worksheets

  1. #1
    Registered User
    Join Date
    11-25-2011
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    53

    Macro help - Copy cells among several worksheets

    Hi,

    I hope somebody can help with this problem, had some great help here in the past.

    I am trying to make a macro which will progress through a column of data and distribute the contents between several other sheets. The purpose is to allocate appointments between a certain number of people who are available for that particular day.

    My main sheet has a list of names and telephone numbers for people who we need to contact. The number of people that the appointments are to be allocated between varies from day to day so I have a cell where I enter this info (name = numPeople), as well as a cell which totals the number of appointment (name = totalEntries). So if there are 100 appointments and 10 people working they should get 10 appointments each. The appointments are ordered by an estimated time, so they should be allocated one at a time between the sheets working down the list. Here is what I have made so far, but it doesn't seem to do anything other than quickly select each cell in turn.

    Please Login or Register  to view this content.
    The code is supposed to use 3 counters:

    mainCounter to track position in main data (sheet name "Data")
    sheetCounter to decide which sheet the data should be pasted to (sheets named "num1", "num2" etc)
    lineCounter to decide which row it should pasting onto in each sheet

    Any help/pointers as to where I'm going wrong would be appreciated, not having much look with Google.

    Regards
    Diberlee

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro help - Copy cells among several worksheets

    you don't need the totalEntries cell, the macro can see the last row with data by simply looking up column A. How's this:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    11-25-2011
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    53

    Re: Macro help - Copy cells among several worksheets

    Thanks JBeaucaire, I'll give that a go when I have some time free and let you know

+ 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