Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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)
-------------------------------------------------------------------

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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)
-------------------------------------------------------------------



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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)
-------------------------------------------------------------------





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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)
-------------------------------------------------------------------




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto file naming Jacquesvv Excel Discussion (Misc queries) 1 June 23rd 09 02:57 PM
Can I auto save to a separate file?(not the file I am working in) Jim Lynch Setting up and Configuration of Excel 1 August 14th 06 05:20 PM
auto save excel file every 10 minutes to its original file name MEG Excel Discussion (Misc queries) 3 September 8th 05 07:12 PM
Check File Name before Save Event ExcelMonkey[_170_] Excel Programming 0 September 29th 04 09:15 AM
Check File Name before Save Event ExcelMonkey[_169_] Excel Programming 1 September 29th 04 01:46 AM


All times are GMT +1. The time now is 12:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"