Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default Saving Workbook


Right now, a button runs the following code:
---------------------------------------------------
Private Sub CmdSubmit_Click()

Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\Census\Archive\" & Sheet1.Cells(1, 1).Value &
".xls"
Application.DisplayAlerts = True

Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\Census\Batch_Files\" & Sheet1.Cells(1, 2).Value
& ".xls"
Application.DisplayAlerts = True

MsgBox ("File Submitted Successfully")

Application.ActiveWorkbook.Close

End Sub
------------------------------------------------
Please tell me how to incorporate a condition which checks if a (C6) is
filled in before saving the file. If cell C6 is empty, I want users to get a
message box stating that they MUST fill in an entry in C6 before saving the
file.

Thanks,

Yasser
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Saving Workbook

See your first post.

yasser wrote:

Right now, a button runs the following code:
---------------------------------------------------
Private Sub CmdSubmit_Click()

Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\Census\Archive\" & Sheet1.Cells(1, 1).Value &
".xls"
Application.DisplayAlerts = True

Application.DisplayAlerts = False
ThisWorkbook.SaveAs "C:\Census\Batch_Files\" & Sheet1.Cells(1, 2).Value
& ".xls"
Application.DisplayAlerts = True

MsgBox ("File Submitted Successfully")

Application.ActiveWorkbook.Close

End Sub
------------------------------------------------
Please tell me how to incorporate a condition which checks if a (C6) is
filled in before saving the file. If cell C6 is empty, I want users to get a
message box stating that they MUST fill in an entry in C6 before saving the
file.

Thanks,

Yasser


--

Dave Peterson
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
Saving Workbook tecklow Excel Discussion (Misc queries) 1 April 22nd 10 04:03 AM
Color Changes When Saving 2007 Workbook as 97 - 2003 Workbook Don Excel Discussion (Misc queries) 0 April 20th 08 04:51 AM
saving workbook Leemac Excel Worksheet Functions 2 February 12th 06 12:28 PM
Saving a sheet in a workbook as .csv but not changing workbook name gloryofbach[_4_] Excel Programming 3 October 30th 05 08:50 PM
Saving a Workbook: Forcing User to Rename before Saving Rollin_Again[_6_] Excel Programming 5 April 16th 04 02:54 PM


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

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

About Us

"It's about Microsoft Excel"