View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Shinka Shinka is offline
external usenet poster
 
Posts: 6
Default Check cells for 'Auto Save As' file naming

I made a button that auto names/saves a file. Problem is they are saving it
with blank cells and hence the file name isn't correct, lol. I would like it
to not let them save it and pop up a message box, prior to the current
MsgBox, if ComboBox1 is "Please Select" and/or "M54" is blank.

This is what I have so far.
Thanks for your programming skills (Ron has been a God send for getting me
this far)

-------------------------------------------------------------
Dim PathName As String
Dim strdate As String
Dim str As String

PathName = "\\Colfs1\public\Operations\RVC-OPS\Fancharts"
strdate = Format(Now, "mm-dd-yy")

With Sheets("VVS Fanchart")
str = strdate & " " & .ComboBox1.Value & " " & .Range("M54")
End With
MsgBox "Saving file to 'RVC-OPS\Fancharts' as:" & " " & str
ActiveWorkbook.SaveAs (PathName & "\" & str)
-------------------------------------------------------------------