#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 76
Default Worksheets

Could you possibly have a solution for me. My information is downloaded into
excel. When it does it gives the workbook a number as the name of the
worksheet. I run a macro and that's no problem, but I wanting to use an
additional macro that will add additional worksheets and do other
calculations. When I try to add the additional worksheets or reference the
numbered worksheet, it won't do it because of the unique number is assigns
each time I download the report. Donna Hauff
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Worksheets

If your running the code with that workbook activated and the single worksheet
as the activesheet, you could use:

Dim wkbk as workbook
dim wks as worksheet

set wkbk = activeworkbook 'or workbooks("somenamehere") if you know the name

set wks = activesheet
or just use the first (and only) worksheet in that workbook
set wks = wkbk.worksheets(1)

Then you can add new worksheets to that workbook and use the data from the
original worksheet (say):

Dim wkbk as workbook
dim wks as worksheet
dim newSht as worksheet
set wkbk = activeworkbook 'or workbooks("somenamehere") if you know the name
set wks = wkbk.worksheets(1)
set newsht = wkbk.worksheets.add

newsht.range("A1").value = wks.range("x99").value 'or whatever

Donna wrote:

Could you possibly have a solution for me. My information is downloaded into
excel. When it does it gives the workbook a number as the name of the
worksheet. I run a macro and that's no problem, but I wanting to use an
additional macro that will add additional worksheets and do other
calculations. When I try to add the additional worksheets or reference the
numbered worksheet, it won't do it because of the unique number is assigns
each time I download the report. Donna Hauff


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Master Worksheets and Individual Worksheets PADutchFireman Excel Worksheet Functions 1 April 2nd 09 05:59 PM
How use info in Excel shared worksheets to create new worksheets dkc Excel Worksheet Functions 0 June 28th 07 08:36 PM
how do i copy a cell in worksheets 10 to the other 9 worksheets bete New Users to Excel 3 March 15th 07 10:41 AM
How do i assign the ActiveWorkbook.Worksheets to a worksheets object? TS Excel Worksheet Functions 2 December 27th 06 02:49 PM
Assigning Cells in worksheets to other data in other worksheets. David McRitchie Excel Discussion (Misc queries) 0 November 27th 04 06:15 PM


All times are GMT +1. The time now is 08:58 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"