ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Creating New Worksheets & Sorting Order of Worksheets (https://www.excelbanter.com/excel-programming/437171-creating-new-worksheets-sorting-order-worksheets.html)

Orion Cochrane

Creating New Worksheets & Sorting Order of Worksheets
 
I have a file with tracking information. One worksheet has the names of all
the people I am tracking, each with their own worksheet. I also have a
UserForm that is used to add people. I would like the following 2 things to
happen (more than likely in my cmdOK_Click event):
1 - Copy a worksheet from one of my existing people, blank out the info, and
rename it the value in my Name field in my UserForm (I used to know how to do
this, but it was last year when I last had the code);
2 - Sort the placement of the worksheets with the people I'm tracking so it
is in the same order as my master worksheet with all the people listed. (I do
not want all the worksheets reordered; just the ones for the people I'm
tracking.)

Any help on this is greatly appreciated, as others will be using this file.
TIA.
--
I am running on Office 2003, unless otherwise stated.

Dave Peterson

Creating New Worksheets & Sorting Order of Worksheets
 
#1. I think I would create a template worksheet (and hide it???). It could be
set up perfectly, but without the data.

Then use that to create the new worksheet.

You can record a macro when you do the copy and rename to get the code.

#2. Chip Pearson and David McRitchie share code to sort sheets:

Chip Pearson's:
http://www.cpearson.com/excel/sortws.htm

David McRitchie's:
http://www.mvps.org/dmcritchie/excel...#sortallsheets

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

Orion Cochrane wrote:

I have a file with tracking information. One worksheet has the names of all
the people I am tracking, each with their own worksheet. I also have a
UserForm that is used to add people. I would like the following 2 things to
happen (more than likely in my cmdOK_Click event):
1 - Copy a worksheet from one of my existing people, blank out the info, and
rename it the value in my Name field in my UserForm (I used to know how to do
this, but it was last year when I last had the code);
2 - Sort the placement of the worksheets with the people I'm tracking so it
is in the same order as my master worksheet with all the people listed. (I do
not want all the worksheets reordered; just the ones for the people I'm
tracking.)

Any help on this is greatly appreciated, as others will be using this file.
TIA.
--
I am running on Office 2003, unless otherwise stated.


--

Dave Peterson


All times are GMT +1. The time now is 04:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com