R
ramboia
Hi I need some help.
I´m beginning in excel macros. So I make a macro that copies some data
sheets from a file in a floopy disk to my current workbook, after then
make a copy to my backup directory and works fine.
But every day I have to edit the macro, because every day the file in
the floppy change and my current wokbook change too, so I would like
costumize, to make a variabe of the names the files:
"A:\STA_FQI_PI-2004-02-07.xls" and "c:\localdocs\today\Relatorio
07.02.2004.xls"
If anyone can help or suggest I´ll say thanks.
Thanks for all
Ramboia
This is my code:
Sub Charge_floopy()
Workbooks.Open Filename:="A:\STA_FQI_PI-2004-02-07.xls"
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Name", "Volumes", "values", "Temperaturas")). _
Select
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Range("A1:AB120").Select
Selection.Copy
Windows("Relatorio 07.02.2004.xls").Activate
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("I", "II", "III", "IV")).Select
Sheets("I").Activate
Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Lote 1").Select
Range("A1").Select
Application.CutCopyMode = False
ChDir "c:\localdocs\today"
ActiveWorkbook.SaveAs Filename:= _
"c:\localdocs\today\Relatorio 07.02.2004.xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False
ActiveWindow.Close
End SubEnd Sub
I´m beginning in excel macros. So I make a macro that copies some data
sheets from a file in a floopy disk to my current workbook, after then
make a copy to my backup directory and works fine.
But every day I have to edit the macro, because every day the file in
the floppy change and my current wokbook change too, so I would like
costumize, to make a variabe of the names the files:
"A:\STA_FQI_PI-2004-02-07.xls" and "c:\localdocs\today\Relatorio
07.02.2004.xls"
If anyone can help or suggest I´ll say thanks.
Thanks for all
Ramboia
This is my code:
Sub Charge_floopy()
Workbooks.Open Filename:="A:\STA_FQI_PI-2004-02-07.xls"
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("Name", "Volumes", "values", "Temperaturas")). _
Select
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Range("A1:AB120").Select
Selection.Copy
Windows("Relatorio 07.02.2004.xls").Activate
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets(Array("I", "II", "III", "IV")).Select
Sheets("I").Activate
Range("A1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("Lote 1").Select
Range("A1").Select
Application.CutCopyMode = False
ChDir "c:\localdocs\today"
ActiveWorkbook.SaveAs Filename:= _
"c:\localdocs\today\Relatorio 07.02.2004.xls", FileFormat _
:=xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:= _
False, CreateBackup:=False
ActiveWindow.Close
End SubEnd Sub