I am trying to create a directory (which this part works) but I need to save the file with the same cell value to that folder
Here is the macro I am working with but I get an error at "fileName = .Range("E50").Text.Copy" & it won't save the file. Could someone tell me how to make this work please?
I appreciate your time.
[code]
Sub CreateFolderAndCopy()
Dim fileName As String
With Sheets(1)
If (.Range("E50") = vbNullString) Then Exit Sub
On Error Resume Next
MkDir "C:\Share\Incoming\" & .Range("E50")
On Error GoTo 0
fileName = .Range("E50").Text.Copy
End With
ActiveWorkbook.SaveAs "C:\Share\" & fileName
End Sub
[\code]
Bookmarks