
www.Usenet.com
| <-- __Chronological__ --> | <-- __Thread__ --> |
i require some help in writing macro in excel 2000 to produce a file
with a filename/path based upon a cell reference.
i have recorded the following macro in excel which produces a basic
csv output file based upon data that sits within a range within my
workbook. i am a bit of a novice at macros, and I bet you all think i
am lazy for recording and not writing one ! this works fine for me.
however, as you will see the filepath is specific to my username.
this workbook is designed to be used by others, and what ideally i
would like to do is to have a cell within the workbook (for the sake
of argument <control and reference>, cell a1) which would contain a
for the output file.
here it is:
>>>>>>>>>
Sub chAmbient()
'
' chAmbient Macro
' Macro recored 10/09/2003 by John.Fairhurst
'
'
Application.Goto Reference:="csvAmbient"
Selection.Copy
Workbooks.Add
Selection.PasteSpecial Paste:=xlFormats, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
ChDir "C:\Documents and Settings\john.fairhurst\Desktop"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and
Settings\john.fairhurst\Desktop\chAmbient.csv", FileFormat:= _
xlCSV, CreateBackup:=False
ActiveWindow.Close
Sheets("control & reference").Select
Range("A1").Select
End Sub
>>>>>>>>>
which parts of the code to i need to alter and with what code ?
many thanks in advance.
john.
| <-- __Chronological__ --> | <-- __Thread__ --> |