#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default 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
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
Copy and paste versus copy and insert copied cells Alana New Users to Excel 1 September 28th 07 08:58 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
EXCEL FILE a copy/a copy/a copy ....filename ve New Users to Excel 1 September 29th 05 09:12 PM
Code to copy range vs Copy Entire Worksheet - can't figure it out Mike Taylor Excel Programming 1 April 15th 04 08:34 PM
How copy format, font, color and border without copy/paste? Michel[_3_] Excel Programming 1 November 5th 03 04:43 PM


All times are GMT +1. The time now is 01:18 PM.

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"