Hello everyone! First time for me in any Forum! I'm not even sure if i'm doing this right.
I'm a beginner in VBA but have been getting by with cut/paste and with information from
Web sources like this forum.
Intuitivley, what i want to do isn't that complicated but I just can't get the code right!
Macro opens a new workbook from a .xlsM file.
User enters values in allowable cells (sheet protected/data validation)
Now
1. Save workbook to one of 3 different folders depending on cell data
2. Name workbook based on cell data.
SUB QUOTE_COPY3()
'
' QUOTE_COPY3 Macro
'
Dim WBQ As Workbook
Dim WSQ As Worksheet
Dim WONUM As Range
Dim STATUS As Range
Set Range("F5").Name = "WONUM"
Set Range("F6").Name = "STATUS"
Set WBQ = ActiveWorkbook 'Workbooks.Add("C:\Users\Steve\AppData\Roaming\Microsoft\Templates\CANQUOTEMPLATE.xltm")
With WBQ
If WSQ("STATUS") = "OPEN" Then
WBQ.SaveAs Filename:=("C:\Users\Steve\documents\Openquotes\ " & WONUM & ".Xls"), FileFormat:=51
End If
Else
If WSQ("STATUS") = "CLOSED" Then
WBQ.SaveAs Filename:=("C:\Users\Steve\documents\Closedquotes\ " & WONUM & ".Xls"), FileFormat:=51
End If
Else
If WSQ("STATUS") = "PENDING" Then
WBQ.SaveAs Filename:=("C:\Users\Steve\documents\Pendinquotes\ " & WONUM & ".Xls"), FileFormat:=51
End If
End With
End Sub
Bookmarks