Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Nikki
 
Posts: n/a
Default Required selection

Is it possible to make a field (check box) required before saving a document?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
BillyRogers
 
Posts: n/a
Default Required selection

Yes, here's an example with a checkbox named Checkbox1
Put this code in the ThisWorkbook module


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Sheet1.CheckBox1.Value = False Then
Cancel = True
MsgBox "Save action cancelled" & vbCrLf & "You must check the
checkbox before saving"
End If


End Sub

If you don't know where the ThisWorkbook module is just reply to this post
and I'll tell you how to get to it.
--
Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Is it possible to make a field (check box) required before saving a document?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Nikki
 
Posts: n/a
Default Required selection

Thank you so much Billy. I thought I knew where the module was, but I guess
I don't. Can you tell me? Thank you!

"BillyRogers" wrote:

Yes, here's an example with a checkbox named Checkbox1
Put this code in the ThisWorkbook module


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Sheet1.CheckBox1.Value = False Then
Cancel = True
MsgBox "Save action cancelled" & vbCrLf & "You must check the
checkbox before saving"
End If


End Sub

If you don't know where the ThisWorkbook module is just reply to this post
and I'll tell you how to get to it.
--
Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Is it possible to make a field (check box) required before saving a document?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
BillyRogers
 
Posts: n/a
Default Required selection

Press Alt+F11 and then on the left side of the screen should be the Project
Exlporer that says "Project -VBAProject" at the top. If you don't see it,
click view on the menu and select project explorer. There may be more than
one project. Make sure you select the project with the same name as your
workbook. If you click the plus sign to expand the project (it may already
be expanded) you will see "Sheet1", "Sheet2", "Sheet3", and "This Workbook".
Double Click where it says "This Workbook" and then past the code into the
code window to the right and click the save button.

Make sure actually have a checkbox on the worksheetand that it's named
Checkbox1


Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Thank you so much Billy. I thought I knew where the module was, but I guess
I don't. Can you tell me? Thank you!

"BillyRogers" wrote:

Yes, here's an example with a checkbox named Checkbox1
Put this code in the ThisWorkbook module


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Sheet1.CheckBox1.Value = False Then
Cancel = True
MsgBox "Save action cancelled" & vbCrLf & "You must check the
checkbox before saving"
End If


End Sub

If you don't know where the ThisWorkbook module is just reply to this post
and I'll tell you how to get to it.
--
Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Is it possible to make a field (check box) required before saving a document?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Nikki
 
Posts: n/a
Default Required selection

I am not having any luck. It is letting me save the document with a false
value. The code I used:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Sheet1.CheckBox1.Value = False Then
Cancel = True
MsgBox "Save action cancelled" & vbCrLf & "You must check the checkbox
before saving"
End If

Is that right? Sorry to be a pain!

"BillyRogers" wrote:

Press Alt+F11 and then on the left side of the screen should be the Project
Exlporer that says "Project -VBAProject" at the top. If you don't see it,
click view on the menu and select project explorer. There may be more than
one project. Make sure you select the project with the same name as your
workbook. If you click the plus sign to expand the project (it may already
be expanded) you will see "Sheet1", "Sheet2", "Sheet3", and "This Workbook".
Double Click where it says "This Workbook" and then past the code into the
code window to the right and click the save button.

Make sure actually have a checkbox on the worksheetand that it's named
Checkbox1


Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Thank you so much Billy. I thought I knew where the module was, but I guess
I don't. Can you tell me? Thank you!

"BillyRogers" wrote:

Yes, here's an example with a checkbox named Checkbox1
Put this code in the ThisWorkbook module


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Sheet1.CheckBox1.Value = False Then
Cancel = True
MsgBox "Save action cancelled" & vbCrLf & "You must check the
checkbox before saving"
End If


End Sub

If you don't know where the ThisWorkbook module is just reply to this post
and I'll tell you how to get to it.
--
Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Is it possible to make a field (check box) required before saving a document?



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Nikki
 
Posts: n/a
Default Required selection

I GOT IT!! Just had to add "end sub" Thank you so much! This will help us
tremendously!

"Nikki" wrote:

I am not having any luck. It is letting me save the document with a false
value. The code I used:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Sheet1.CheckBox1.Value = False Then
Cancel = True
MsgBox "Save action cancelled" & vbCrLf & "You must check the checkbox
before saving"
End If

Is that right? Sorry to be a pain!

"BillyRogers" wrote:

Press Alt+F11 and then on the left side of the screen should be the Project
Exlporer that says "Project -VBAProject" at the top. If you don't see it,
click view on the menu and select project explorer. There may be more than
one project. Make sure you select the project with the same name as your
workbook. If you click the plus sign to expand the project (it may already
be expanded) you will see "Sheet1", "Sheet2", "Sheet3", and "This Workbook".
Double Click where it says "This Workbook" and then past the code into the
code window to the right and click the save button.

Make sure actually have a checkbox on the worksheetand that it's named
Checkbox1


Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Thank you so much Billy. I thought I knew where the module was, but I guess
I don't. Can you tell me? Thank you!

"BillyRogers" wrote:

Yes, here's an example with a checkbox named Checkbox1
Put this code in the ThisWorkbook module


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Sheet1.CheckBox1.Value = False Then
Cancel = True
MsgBox "Save action cancelled" & vbCrLf & "You must check the
checkbox before saving"
End If


End Sub

If you don't know where the ThisWorkbook module is just reply to this post
and I'll tell you how to get to it.
--
Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Is it possible to make a field (check box) required before saving a document?

  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 184
Default Required selection

I've finally got the error message to appear on the document, but now I can't
save the document without the checkbox marked. How do I get around that???

"BillyRogers" wrote:

Press Alt+F11 and then on the left side of the screen should be the Project
Exlporer that says "Project -VBAProject" at the top. If you don't see it,
click view on the menu and select project explorer. There may be more than
one project. Make sure you select the project with the same name as your
workbook. If you click the plus sign to expand the project (it may already
be expanded) you will see "Sheet1", "Sheet2", "Sheet3", and "This Workbook".
Double Click where it says "This Workbook" and then past the code into the
code window to the right and click the save button.

Make sure actually have a checkbox on the worksheetand that it's named
Checkbox1


Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Thank you so much Billy. I thought I knew where the module was, but I guess
I don't. Can you tell me? Thank you!

"BillyRogers" wrote:

Yes, here's an example with a checkbox named Checkbox1
Put this code in the ThisWorkbook module


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Sheet1.CheckBox1.Value = False Then
Cancel = True
MsgBox "Save action cancelled" & vbCrLf & "You must check the
checkbox before saving"
End If


End Sub

If you don't know where the ThisWorkbook module is just reply to this post
and I'll tell you how to get to it.
--
Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Is it possible to make a field (check box) required before saving a document?

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Required selection

And if users choose to disable macros when they open the workbook, what then?

A whole 'nother can of worm-like creatures will appear.


Gord Dibben MS Excel MVP

On Fri, 4 Aug 2006 14:13:01 -0700, Nikki
wrote:

I've finally got the error message to appear on the document, but now I can't
save the document without the checkbox marked. How do I get around that???

"BillyRogers" wrote:

Press Alt+F11 and then on the left side of the screen should be the Project
Exlporer that says "Project -VBAProject" at the top. If you don't see it,
click view on the menu and select project explorer. There may be more than
one project. Make sure you select the project with the same name as your
workbook. If you click the plus sign to expand the project (it may already
be expanded) you will see "Sheet1", "Sheet2", "Sheet3", and "This Workbook".
Double Click where it says "This Workbook" and then past the code into the
code window to the right and click the save button.

Make sure actually have a checkbox on the worksheetand that it's named
Checkbox1


Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Thank you so much Billy. I thought I knew where the module was, but I guess
I don't. Can you tell me? Thank you!

"BillyRogers" wrote:

Yes, here's an example with a checkbox named Checkbox1
Put this code in the ThisWorkbook module


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Sheet1.CheckBox1.Value = False Then
Cancel = True
MsgBox "Save action cancelled" & vbCrLf & "You must check the
checkbox before saving"
End If


End Sub

If you don't know where the ThisWorkbook module is just reply to this post
and I'll tell you how to get to it.
--
Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Is it possible to make a field (check box) required before saving a document?


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 78
Default Required selection

Nikki,

What exactly is it you are trying to do? Maybe i can help if I understand
what you are trying to do a little better. Do you want the workbook to open
with the checkbox unchecked? and then require that it be checked before it is
closed?
You could comment out the code to save it but then it won't be active when
you open it.

Why do they need to check this box before saving it? What does the
checkbox signify?



Gord,
"And if users choose to disable macros when they open the workbook, what
then?"

I don't what the point of that comment is. Totally stupid. Can't you say
this about any macro that someone writes? People are here for help and
suggestions. Tell her a better way if you know one. I just offered her the
limited help that I am able to with the small amount of experiece I have.

--
Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

I've finally got the error message to appear on the document, but now I can't
save the document without the checkbox marked. How do I get around that???

"BillyRogers" wrote:

Press Alt+F11 and then on the left side of the screen should be the Project
Exlporer that says "Project -VBAProject" at the top. If you don't see it,
click view on the menu and select project explorer. There may be more than
one project. Make sure you select the project with the same name as your
workbook. If you click the plus sign to expand the project (it may already
be expanded) you will see "Sheet1", "Sheet2", "Sheet3", and "This Workbook".
Double Click where it says "This Workbook" and then past the code into the
code window to the right and click the save button.

Make sure actually have a checkbox on the worksheetand that it's named
Checkbox1


Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Thank you so much Billy. I thought I knew where the module was, but I guess
I don't. Can you tell me? Thank you!

"BillyRogers" wrote:

Yes, here's an example with a checkbox named Checkbox1
Put this code in the ThisWorkbook module


Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)

If Sheet1.CheckBox1.Value = False Then
Cancel = True
MsgBox "Save action cancelled" & vbCrLf & "You must check the
checkbox before saving"
End If


End Sub

If you don't know where the ThisWorkbook module is just reply to this post
and I'll tell you how to get to it.
--
Billy Rogers

Dallas,TX

Currently Using Office 2000


"Nikki" wrote:

Is it possible to make a field (check box) required before saving a document?

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default Required selection

Feedback is always appreciated.

Thanks, Gord

On Fri, 4 Aug 2006 20:38:02 -0700, BillyRogers
wrote:

Nikki,

What exactly is it you are trying to do? Maybe i can help if I understand
what you are trying to do a little better. Do you want the workbook to open
with the checkbox unchecked? and then require that it be checked before it is
closed?
You could comment out the code to save it but then it won't be active when
you open it.

Why do they need to check this box before saving it? What does the
checkbox signify?



Gord,
"And if users choose to disable macros when they open the workbook, what
then?"

I don't what the point of that comment is. Totally stupid. Can't you say
this about any macro that someone writes? People are here for help and
suggestions. Tell her a better way if you know one. I just offered her the
limited help that I am able to with the small amount of experiece I have.


Gord Dibben MS Excel MVP
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
Add "left align across selection" cell formatting Monty Analyst Excel Worksheet Functions 2 November 5th 08 03:17 PM
Insert Picture from dropdown selection Mike at Channel New Users to Excel 21 March 22nd 06 01:14 AM
Max Value in a column exclude selection - Excel VBA magix Excel Discussion (Misc queries) 3 November 5th 05 09:18 PM
Cell Selection after "Enter" Synectica Excel Discussion (Misc queries) 6 August 29th 05 09:55 PM
limit cell list selection based on the selection of another list lorraine Excel Worksheet Functions 2 December 14th 04 08:17 PM


All times are GMT +1. The time now is 09:00 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"