Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Master Worksheets and Individual Worksheets | Excel Worksheet Functions | |||
How use info in Excel shared worksheets to create new worksheets | Excel Worksheet Functions | |||
how do i copy a cell in worksheets 10 to the other 9 worksheets | New Users to Excel | |||
How do i assign the ActiveWorkbook.Worksheets to a worksheets object? | Excel Worksheet Functions | |||
Assigning Cells in worksheets to other data in other worksheets. | Excel Discussion (Misc queries) |