Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy
Hi!
When my workbook (VT - it includes only one sheet)) is opened (it's in a network), this will happend: ReportNumber = ActiveSheet.Range("e5").Value ReportNumber = ActiveSheet.Range("e5").Value + 1 ActiveSheet.Range("e5").Value = ReportNumber FileSaveName = ActiveWorkbook.Path FileSaveNameEnd = FileSaveName & "\Arkiv\" varName = ActiveSheet.Name varDir = FileSaveNameEnd varYear = Format(Date, "yy") varNr = ReportNumber On Error GoTo ErrorHandler: ActiveSheet.SaveAs Filename:=varDir & varName & varNr & varYear **After the workbook is opened a macro open another workbook called Statistikk (the user should not see this) Fileopen = ActiveWorkbook.Path Fileopenend = Fileopen & "\Arkiv\" & "Statistikk" Workbooks.Open "FileSaveName & FileSaveNameEnd & Statistikk" **and here is my problem, i want the information that is put into cell e5 also should be put into a specific cell into the new workbook (Statstikk) Sheet (Ark1) *****Here is my problem FirstCol = Workbooks(Statistikk).Worksheets(Ark1).Range_("Rep ort_Number").Column FirstRow = ReportNumber Cells(FirstRow, FirstCol).Value = ReportNumber I would appreciate all help! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy
At top of general module, before any Sub(), put:
Public ReportNumber As Long This allows the variable to be passed to all procedures in the workbook In second macro that opens Statstikk, once it is open: Workbooks(Statistikk).Worksheets(Ark1).Range("A1") .Value = ReportNumber Mike F "Michael" wrote in message ... Hi! When my workbook (VT - it includes only one sheet)) is opened (it's in a network), this will happend: ReportNumber = ActiveSheet.Range("e5").Value ReportNumber = ActiveSheet.Range("e5").Value + 1 ActiveSheet.Range("e5").Value = ReportNumber FileSaveName = ActiveWorkbook.Path FileSaveNameEnd = FileSaveName & "\Arkiv\" varName = ActiveSheet.Name varDir = FileSaveNameEnd varYear = Format(Date, "yy") varNr = ReportNumber On Error GoTo ErrorHandler: ActiveSheet.SaveAs Filename:=varDir & varName & varNr & varYear **After the workbook is opened a macro open another workbook called Statistikk (the user should not see this) Fileopen = ActiveWorkbook.Path Fileopenend = Fileopen & "\Arkiv\" & "Statistikk" Workbooks.Open "FileSaveName & FileSaveNameEnd & Statistikk" **and here is my problem, i want the information that is put into cell e5 also should be put into a specific cell into the new workbook (Statstikk) Sheet (Ark1) *****Here is my problem FirstCol = Workbooks(Statistikk).Worksheets(Ark1).Range_("Rep ort_Number").Column FirstRow = ReportNumber Cells(FirstRow, FirstCol).Value = ReportNumber I would appreciate all help! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy and paste versus copy and insert copied cells | New Users to Excel | |||
Copy/Paste how to avoid the copy of formula cells w/o calc values | Excel Discussion (Misc queries) | |||
EXCEL FILE a copy/a copy/a copy ....filename | New Users to Excel | |||
Code to copy range vs Copy Entire Worksheet - can't figure it out | Excel Programming | |||
How copy format, font, color and border without copy/paste? | Excel Programming |