Thread: VBA Not working
View Single Post
 
Old 05-11-2019, 10:54 AM
p45cal's Avatar
p45cal p45cal is offline Windows 10 Office 2016
Expert
 
Join Date: Apr 2014
Posts: 871
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

a guess, and untested:
Code:
Sub blah()
Dim part1 As String
Dim part2 As String
Dim part3 As String
'setting out the cells
Dim strUser As String

strUser = Environ("UserName")
Application.DisplayAlerts = False
For Each sht In Sheets(Array("Acumen", "Carlson", "Gefco"))
  With sht
    part1 = .Range("A2").Value
    part2 = .Range("C2").Value
    part3 = .Range("L2").Value
    .Move
  End With
  ActiveWorkbook.SaveAs Filename:="C:\Documents and Settings\" & strUser & "\Desktop\Forecast\" & part1 & " " & part2 & " " & part3 & ".xlsx", FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
  ActiveWindow.Close
Next sht
Application.DisplayAlerts = True
End Sub
Reply With Quote