ndendrinos
03-13-2010, 01:47 PM
This code works
If in B8 I type "Toyota"
and in F6 I type "1234"
a new WB titled Toyota1234 is saved on my desktop.
I need a space between Toyota and 1234
The save as name will be Toyota 1234
Thank you
Sub Email()
Application.ScreenUpdating = False
Worksheets("Invoice").Range("A2:F45").Copy
Worksheets("Your Invoice").Activate
Worksheets("Your Invoice").Range("A2").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Dim newFile As String
Dim ms As String
ms = [B8] & "" & [f6].Value
newFile = ms
strPath = ThisWorkbook.Path
ThisWorkbook.ActiveSheet.Copy
ActiveWorkbook.SaveAs fileName:=strPath & "\" & newFile
Dim Links As Variant
Dim i As Integer
With ActiveWorkbook
Links = .LinkSources(xlExcelLinks)
If Not IsEmpty(Links) Then
For i = 1 To UBound(Links)
.BreakLink Links(i), xlLinkTypeExcelLinks
Next i
End If
End With
[A1].Select
ActiveWorkbook.Save
ActiveWorkbook.Close
Worksheets("Invoice").Activate
ActiveWorkbook.Save
MsgBox prompt:="Done"
Application.ScreenUpdating = True
End Sub
If in B8 I type "Toyota"
and in F6 I type "1234"
a new WB titled Toyota1234 is saved on my desktop.
I need a space between Toyota and 1234
The save as name will be Toyota 1234
Thank you
Sub Email()
Application.ScreenUpdating = False
Worksheets("Invoice").Range("A2:F45").Copy
Worksheets("Your Invoice").Activate
Worksheets("Your Invoice").Range("A2").PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Dim newFile As String
Dim ms As String
ms = [B8] & "" & [f6].Value
newFile = ms
strPath = ThisWorkbook.Path
ThisWorkbook.ActiveSheet.Copy
ActiveWorkbook.SaveAs fileName:=strPath & "\" & newFile
Dim Links As Variant
Dim i As Integer
With ActiveWorkbook
Links = .LinkSources(xlExcelLinks)
If Not IsEmpty(Links) Then
For i = 1 To UBound(Links)
.BreakLink Links(i), xlLinkTypeExcelLinks
Next i
End If
End With
[A1].Select
ActiveWorkbook.Save
ActiveWorkbook.Close
Worksheets("Invoice").Activate
ActiveWorkbook.Save
MsgBox prompt:="Done"
Application.ScreenUpdating = True
End Sub