Create new directory

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.
 
D

Dave Peterson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top