D
dancing fish
Hi all,
VBA question.
I've opened up MyFile, copied some info, pasted it, and now i want t
close MyFile without saving changes. Myfile does not have a
application extension such as .xls.
This doesnt work because I don't know what I'm doing!
Windows("MyFile").Select
ActiveWindow.Close
Please help.
The full code is below:
Sub GetInfo()
'
' GetInfo Macro
' Macro recorded 10/01/2004 by Awyatt
'
'
Application.ScreenUpdating = False
Dim MyFile As String
Dim MyRange As String
Sheets("MyRange").Select
Range("d17").Select
MyRange = ActiveCell.Value
Sheets("File").Select
Range("B3").Select
MyFile = ActiveCell.Value
Workbooks.Open Filename:=MyFile, UpdateLinks:=3
Sheets("UK Price Retail").Select
Range(MyRange).Select
Selection.Copy
Windows("NewSystem.xls").Activate
Sheets("Costs").Select
Range("B3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Windows("MyFile").Select
ActiveWindow.Close
Windows("NewSystem.xls").Select
Sheets("Input").Select
End Su
VBA question.
I've opened up MyFile, copied some info, pasted it, and now i want t
close MyFile without saving changes. Myfile does not have a
application extension such as .xls.
This doesnt work because I don't know what I'm doing!
Windows("MyFile").Select
ActiveWindow.Close
Please help.
The full code is below:
Sub GetInfo()
'
' GetInfo Macro
' Macro recorded 10/01/2004 by Awyatt
'
'
Application.ScreenUpdating = False
Dim MyFile As String
Dim MyRange As String
Sheets("MyRange").Select
Range("d17").Select
MyRange = ActiveCell.Value
Sheets("File").Select
Range("B3").Select
MyFile = ActiveCell.Value
Workbooks.Open Filename:=MyFile, UpdateLinks:=3
Sheets("UK Price Retail").Select
Range(MyRange).Select
Selection.Copy
Windows("NewSystem.xls").Activate
Sheets("Costs").Select
Range("B3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone
SkipBlanks:= _
False, Transpose:=False
Windows("MyFile").Select
ActiveWindow.Close
Windows("NewSystem.xls").Select
Sheets("Input").Select
End Su