ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Check cells for 'Auto Save As' file naming (https://www.excelbanter.com/excel-programming/343224-check-cells-auto-save-file-naming.html)

Shinka

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)
-------------------------------------------------------------------


Ron de Bruin

Check cells for 'Auto Save As' file naming
 
Hi

Try this Shinka

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")
If .ComboBox1.Value = "Please Select" Or .Range("M54").Value = "" Then
MsgBox "Please select a item in the combo or/and enter a value in M54"
Else
str = strdate & " " & .ComboBox1.Value & " " & .Range("M54")
End With
MsgBox "Saving file to 'RVC-OPS\Fancharts' as:" & " " & str
ActiveWorkbook.SaveAs (PathName & "\" & str)
End If


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Shinka" wrote in message ...
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)
-------------------------------------------------------------------




Ron de Bruin

Check cells for 'Auto Save As' file naming
 
Shinka

The End With
Must be below the End If



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Ron de Bruin" wrote in message ...
Hi

Try this Shinka

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")
If .ComboBox1.Value = "Please Select" Or .Range("M54").Value = "" Then
MsgBox "Please select a item in the combo or/and enter a value in M54"
Else
str = strdate & " " & .ComboBox1.Value & " " & .Range("M54")
End With
MsgBox "Saving file to 'RVC-OPS\Fancharts' as:" & " " & str
ActiveWorkbook.SaveAs (PathName & "\" & str)
End If


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Shinka" wrote in message ...
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)
-------------------------------------------------------------------






Shinka

Check cells for 'Auto Save As' file naming
 
Had to move End With after End If but it works.

Thanks so much Ron!

"Ron de Bruin" wrote:

Hi

Try this Shinka

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")
If .ComboBox1.Value = "Please Select" Or .Range("M54").Value = "" Then
MsgBox "Please select a item in the combo or/and enter a value in M54"
Else
str = strdate & " " & .ComboBox1.Value & " " & .Range("M54")
End With
MsgBox "Saving file to 'RVC-OPS\Fancharts' as:" & " " & str
ActiveWorkbook.SaveAs (PathName & "\" & str)
End If


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Shinka" wrote in message ...
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)
-------------------------------------------------------------------






All times are GMT +1. The time now is 06:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com