Consulting

Results 1 to 7 of 7

Thread: Solved: Create new tab based on list

  1. #1

    Solved: Create new tab based on list

    Hello to you gods of VBA

    I'm looking for a two part help on this project please

    I have a workbook, in a portion of this deals with scores, and the displaying of them.

    Part one

    There is the main data tab "Audit Scores" and what I need to do, is check for unique values in column B, and then check to see if there already exists a tab for that name, and if not I need it to create that tab, and copy the macros from another of the agent tabs onto this tab (these macros unhide columns, advance filter the Audit scores based on agent name, then rehide the columns).

    Part two
    There are column graphs covering the data on the agent tab, but i need these to resize automatically based on tne number of rows returned.

    I have put my macro's on the worksheet_activate action as there will be otehr sheets that dont need to be touched, and to be honest I'm not sure how I would loop a macro to go through only the required worksheets (column B in "Audit Scores").

    Please see sample workbook which may make it easier to decipher my garbled request.

    So if anyone can point me in the rgiht direction I would be most grateful.
    Attached Files Attached Files

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Rather than have all of the same code in each worksheet module, you would be better to have a workbook sheet activate event that tests the worksheet name to be of the required format .
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Hi XLD,

    thanks for responding.

    I'm with you, it probably would be easier to have the code once, and then loop through the workbook, but my lack of knowledge & experience means I dont have the necessary skills to be able to do that, hence the worksheet codes.

    I'm always open to suggestions if there is a better way, this does sound like a better way and if you could possibly supply a bit of code to achieve that then i would be most grateful.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    I did try and work it through in the workbook, but the advanced filter did not work. Give me a bit more time.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    Take as much time as you need, before yesterday I didnt even know how to use advanced filters let alone using it with VBA.

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    How about this?
    Attached Files Attached Files
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  7. #7
    Thanks XLD,

    just what I needed.

Posting Permissions

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