fuzy
07-11-2008, 02:17 PM
the problem:
' Time Macro
' Macro enregistr?e le 27/06/2008 par
'
'
Application.Goto Reference:="R2C1"
Range("A2:C2").Select
Selection.Copy
Workbooks.Open Filename:=ThisWorkbook.Path & Application.PathSeparator & "test\ times.xls"
Range("G3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWindow.Close
Application.Goto Reference:="R2C1"
Selection.Copy
Range("M2").Select
Selection.Insert Shift:=xlDown
Application.Goto Reference:="R1C1"
Application.CutCopyMode = False
End Sub
I have Datas/logs/test directories lets say I have a file in logs directory and so when I copy a cell to a file time.xls which locates in test directory it works. I can also do it if the file is in the same directory. But can I somehow reach the previous directory 'datas' from 'logs'? I have this file system on all of different computers but not always on the same location, so when I copy it should work without the full path name. I already tried:
filetoopen = Application.GetOpenFilename("Review Files (*.xls), *.xls")
but in this case I need to select the location and the file name, which brings up more possible error chances if others do not select the right file.
Please help me on this , if it's not possible just give me a note, that I should forget about the whole thing.
I might won't be able to see the answer for a week, but hopefully it is clear for you guys.
Thnx G.
' Time Macro
' Macro enregistr?e le 27/06/2008 par
'
'
Application.Goto Reference:="R2C1"
Range("A2:C2").Select
Selection.Copy
Workbooks.Open Filename:=ThisWorkbook.Path & Application.PathSeparator & "test\ times.xls"
Range("G3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ActiveWorkbook.Save
ActiveWindow.Close
Application.Goto Reference:="R2C1"
Selection.Copy
Range("M2").Select
Selection.Insert Shift:=xlDown
Application.Goto Reference:="R1C1"
Application.CutCopyMode = False
End Sub
I have Datas/logs/test directories lets say I have a file in logs directory and so when I copy a cell to a file time.xls which locates in test directory it works. I can also do it if the file is in the same directory. But can I somehow reach the previous directory 'datas' from 'logs'? I have this file system on all of different computers but not always on the same location, so when I copy it should work without the full path name. I already tried:
filetoopen = Application.GetOpenFilename("Review Files (*.xls), *.xls")
but in this case I need to select the location and the file name, which brings up more possible error chances if others do not select the right file.
Please help me on this , if it's not possible just give me a note, that I should forget about the whole thing.
I might won't be able to see the answer for a week, but hopefully it is clear for you guys.
Thnx G.