Create new directory

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm new with Exel, so please bear with me.


Sub saveascode()
Dim sFileName As String

Range("A3").Select
Selection.Copy
Range("F3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
sFileName = Worksheets("Hotline").Range("F3").Value
ThisWorkbook.SaveAs Filename:="C:\peter\3\" & sFileName & ".xls"
Range("F3").Select
Selection.ClearContents
End Sub

This saves my Exel file by giving it the file name found in A3.
I want to save it as C:\peter\3\"contents of A3"\"original file name".xls


How can I create and name a new directory in a macro.
 
See one reply at your other post.

I'm new with Exel, so please bear with me.

Sub saveascode()
Dim sFileName As String

Range("A3").Select
Selection.Copy
Range("F3").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Application.CutCopyMode = False
sFileName = Worksheets("Hotline").Range("F3").Value
ThisWorkbook.SaveAs Filename:="C:\peter\3\" & sFileName & ".xls"
Range("F3").Select
Selection.ClearContents
End Sub

This saves my Exel file by giving it the file name found in A3.
I want to save it as C:\peter\3\"contents of A3"\"original file name".xls

How can I create and name a new directory in a macro.
 
Back
Top