Remove Close X From User Form

Oct 10, 2008

how you can remove the close 'X' on the title bar of a user form please? I have used this for a password input box but if the user selects the 'X' on the title bar then it closes the password box without them having to enter a password and allows them into the workbook.

View 2 Replies


ADVERTISEMENT

Open Only The User Form ... Or Close Everything

Mar 22, 2006

Assume that the workbook Book1.xls opens a user form named myUserForm.

I'm trying to show only the user form on the desktop when I open Book1.xls, with Book1.xls minimized on the Taskbar.

And , if the Cancel button on the form is clicked, then unload the form and close Book1.xls.

That simple!

In ThisWorkbook, I have the event:

Private Sub Workbook_Open()
ActiveWindow.WindowState = xlMinimized
ShowTheForm
End Sub
On the Form, I have the Cancel button:

Private Sub btnCancel_Click()
Unload Me
ThisWorkbook.Close True
End Sub

The above procedure shows the form, with Microsoft Excel blank window in the background, and produces a small bar at the bottom left of the screen for Book1.xls
Click the Cancel button, and both the Form and Book1.xls close, but the blank Excel window remain open !

I suppose I would not be able to edit this version of Book1.xls, but that is fine for now!

View 9 Replies View Related

Text Box To Keep Value After Close Of User Form

May 10, 2007

How do I define the variable in a text box so that it stays in that text box after the close of the dialog box. For example, I enter "Test" in TextBox1 then close UserForm1. I want to be able to open UserForm1 back up and still have the same user defined text in there.

View 9 Replies View Related

Save The Values Before Close User Form

Feb 1, 2008

Is there a way for me to save the values inside a userform to public variables when a user closes the form?

View 9 Replies View Related

When Close Worksheet Its Reopens The User Form And Hits Start

Oct 23, 2009

I have a userform, every time the user clicks on the start button it recodes there name, today’s date and their start time when they hit finish it records their end time.

The next time the user hits start it will record the users name, today’s date and start time on the next row (below their last entry)

The problem I have is that if the user clicks on start and then does not click on end button, but instead exits excel, then reopens the user form and hits start. The start will go on the row below, but now when they click on the end button the end time will go into the previous row for the end time, as they did not put it in if you know what I mean.

User NameDateStartEndTotal TimeTime InactiveClaire Watts
23/10/0915:04:2515:04:420:00:170:00:17Claire Watts
23/10/0915:04:4715:04:540:00:070:00:05Claire Watts
23/10/0915:04:5515:05:060:00:110:00:01Claire Watts
23/10/0915:05:0815:06:100:00:150:00:02Claire Watts
23/10/0915:05:55

#######Claire Watts
23/10/0915:06:18

15:06:18


I want to stop the user from being able to exit excel if they had clicked on start

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Cancel = True
MsgBox "You have clicked on Start and therefore mus Click the End button before you can exit excel.", vbCritical, "Cannot Close"

End Sub

This disables the X in the top right hand corner, I have aready disabled the one in the user form. However the following code does not let the user exit via File and Exit. Is there a way to put an IF statement into this that say if CmdStart has been clicked then the user can not exit, How every if it has not then they can exit.

I have read threads on this forum as well as on others and this does seam to be and issue.

OR is there a way of Hiding the X button that is in the top right hand corner. However this will still allows the user to hit start button and then exit excel, which will continue with the problem.

View 10 Replies View Related

Remove User Form Borders

Aug 1, 2009

I am using a user form to display a splash screen. In the user form, I have a picture that is being displayed as splash screen for 5 seconds and then it disappears. I only want to display the picture in the splash screen. I want to to remove the following three items
from the user form:

1 - remove all borders
2 - remove the menu/caption bar
3 - remove the "x" button that allows user to close form.

View 3 Replies View Related

Remove A User Form Border

Jul 28, 2006

The border around a user form is really annoying. Is there any way to remove this so that when you load the user form without a title bar your image you use is just your image and not with a border around it???

View 4 Replies View Related

User Form To Remove Data From A Database

Feb 9, 2010

I have created my first user form that puts the info gathered onto a seperate sheet.

We are a garage and its for cars that come into stock.

What I want to do is when we sell a car, have a way of removing the car from the database but recording the infomation that was in the first database and some additional infomation like who sold it and the selling price.

View 7 Replies View Related

Remove Checkbox Ticks From Last Use Upon Opening User Form

Jun 2, 2009

I am simply trying to write a macro or code that will set all the check box values to "False" each time I initiate the User form. So that the user form does not "carry over" check box values from the last time the User form was used.

However I had to make sure I cleared the value from the cell that each control is associated with.(the controlsource in the user form properties.)

View 9 Replies View Related

Hiding The "X" Or Close Button On A User Form

Mar 8, 2003

I need to hide the "X" or close button on a user form so that users have to use the next or ok buttons that i have added.

View 9 Replies View Related

User Form-Easy Selection Of Data To Be Filled In The Form

Jun 3, 2006

find the attached workbook

I have a Database and user form, in the user form i have a field named “Vehicle No” this is a combo box from which a user needs to select the Vehicle numbers, and all these are working fine now, I need your help in the following:

When user selects the second field named "Select Vendor name" i need a pop up window which shows all the Vehicles belongs to the vendor which they have selected, and with the popup window user selects the vehicle number then the Vehicle number combo box should be filled.

Currently users have to select by scrolling through Combo box which takes long time and difficult to find by scrolling.

View 7 Replies View Related

Prevent The User From Saving The Data Input From The User Form If Any Of Those Three Fields Is Left Blank

Feb 9, 2010

I have a user form that has a combo box "City" two text boxes one called "Flight" and the other "Date". What I'm trying to do is to prevent the user from saving the data input from the user form if any of those three fields is left blank. The code that I have so far checks all of the required fields, if any are left blank a message notifys which field(s) is left blank and return the focus back to that field. But the rest of code also fires.

What I really need is either to stop the code if any fields are blank and return the focus back to the blank field, the user completes the field(s) and clicks the save again, or better yet, pause the code until all the required fields are completed and then complete the save. (There is actually another 200+ lines of code in this sub, but I deleted it to keep the post a little shorter.)

View 2 Replies View Related

Look Up Data And Plug Into Form - User Form In Reverse?

Jan 14, 2009

I have created a registration workbook for this year's youth sports league. All of the information is entered into a User Form and separated onto it's appropriate sheet designated by the child's age. Next year, I would like to use this year's workbook to look up returning players.

Will it be possible to add a "lookup" button into my form, or create a lookup program, that once the registrar clicks on the correct player, the information is plugged into the User Form, the registrar adjusts the age and any necessary info, presses enter, and the information is copied into the appropriate category in the new workbook? I haven't worked with User Forms long enough to know if they can be filled in that way, but if this can be done, you are the people who would know.

View 3 Replies View Related

Unload Or Hide User Form On Show Next Form

Dec 2, 2008

I'm using a series of user forms for data entry to a workbook, some of them open next stage user form on completion (OK cmd button).

All that is working fine, but I'd like the initial form to close on showing the next one. I've tried adding Unload and Hide commands following the frmInsertEntry.Show (Next stage form), to no avail, but I'd like this user form to close or hide at the end of the sub.

Private Sub cmdContinueType_Click()

ActiveWorkbook.Sheets("Records").Activate 'Select starting cell in record sheet
Range("N3").Select

Do
If IsEmpty(ActiveCell) = False Then ' Search for next empty cell
ActiveCell.Offset(1, 0).Select
End If
Loop Until IsEmpty(ActiveCell) = True

If optDrillType = True Then
frmDrillEntry.Show
Else
frmInsertEntry.Show
End If

End Sub

View 9 Replies View Related

Close The Form

Oct 8, 2008

I found this code and I liked to use it, however it does not close the form.

Private Sub cmdBtMain_Click()
frmMain.Show
frmFenster.Close
End Sub

View 9 Replies View Related

Disable Form Close

Dec 13, 2006

Is there any easy way to disable the close (X) button at the top right of a form.

I've been trying...

Private Sub UserForm_Terminate()
UserForm1.Show
Unload UserForm2
End Sub

but i get a problem when re-opening the userform2??

View 2 Replies View Related

Remove Empty Row Upon Close

Jan 26, 2013

How would the attached file code be ammended to remove a blank row and then move all remaining rows below up one ?

Example: Open the attached file (Transport Log version 1). If you double-click in cell "X10" (for patient Abe Lincoln), the data for row 10 will be removed and written to Sheet #2. Closing the file and reopening, row 10 is empty with other rows below remaining. The goal is to move the data in rows 11 and 12 (and any subsequent rows that may be entered below those) up one row.

The above method would be an indication to users making subsequent entries to always use the first empty row below all existing data.

View 1 Replies View Related

Remove UserForm On Close

Dec 18, 2009

I have a function (courtesy of Walkanbach) to create a userform, very useful as it means I keep memory down as I can create the UF's as I go and tweak to suit.

I have been trying to get the userform to be removed when the user closes it. The close action in this case is the X button top right as this userform only has the userform itself and a listbox.

When I set the code for the event procedure it doesn't error, but nothing happens. The microsoft help pages seem to suggest that you can't remove a userform through vba, but I find that hard to believe. I've tried variations on the close procedure and all to no avail so far.

Dim xInt As Integer
With TempForm.CodeModule
xInt = .CountOfLines
.InsertLines xInt + 1, "Private Sub TempForm_Terminate()"
.InsertLines xInt + 2, "ThisWorkbook.VBProject.VBComponents.Remove TempForm"
.InsertLines xInt + 3, "End Sub"
End With

View 9 Replies View Related

VB Component: Remove Before Close

Apr 15, 2005

I have been deleting some VBComponents by using the .remove command and they get tagged for deletion but do not actually get deleted until after my VBA sub ends and control is returned to excel.

I would like to save the changes before control is returned to the user. I'm not really sure why the deletion is being held up until execution ends, it even waits until all calling functions have also finished their execution.

View 9 Replies View Related

Remove Autofilters Before Save & Close

Jun 11, 2008

I have an issue where users to a work book are selecting autofilter and then saving the document with rows filtered out, which I wish to prevent or at least warn them to remove the filter before allowing the save function.

The document is never 'Save As', it's always 'Save' from the toolbar icon.

They should be permitted to save the document, but only after this check has been completed and a message issued if the filter is on.

View 4 Replies View Related

Auto Close Workbook After Showing Form For 30 Seconds

Mar 24, 2007

I have the following code that displays a form at a user defined time and if the user does not press "Stop" then the workbook saves and closes. The user can press stop then the workbook remains open.

Here is what I have where:
Admin_Auto_Shutdown = Yes or No
Admin_Auto_Shutdown_Time = 3:34pm or user defined time (This doesn't seem to work??)

'Auto Shutdown CloseandSave
If UCase(wb.Worksheets("Admin"). Range("Admin_Auto_Shutdown").Value) = "YES" Then
Application .OnTime TimeValue("Admin_Auto_Shutdown_Time"), "AutoShutdown"
End If

Sub AutoShutdown()

Application.OnTime TimeValue("Admin_Auto_Shutdown_Time"), "AutoShutdown"

Auto_Shutdown_Form.Show

End Sub

Now, my question is about a timer that I can show on a form. When the form is displayed I would like to give the user 30 seconds to press stop (and keep the workbook open) or to press proceed and save and close or to not do anything and the workbook would close and save when the timer reaches zero.

Code for user form which is missing most everything...

Private Sub Halt_Click()
'If user whats to continue without closing
Auto_Shutdown_Form.Hide
End Sub

Private Sub Proceed_Click()
'If user whats to save and close

Auto_Shutdown_Form.Hide

How do I add a timer to this code where it will run this at the end of the timer?

Auto_Shutdown_Form.Hide

Application.DisplayAlerts = False
With ThisWorkbook
.Saved = True
.Close
End With

View 4 Replies View Related

Stop Close Form Button Working On Userforms

Jul 16, 2007

I have a useform that loads up with two buttons and I waat to force the user to chose one of the buttons. However, I have noticed that the user can just press the cross in the top right corner of the form to close the window and therefore not press either button.

Is there anyway I can stop the close form button working?

View 4 Replies View Related

Before Close Event (check User If They Logged Out?)

Jun 6, 2008

I am trying to ask to the user to check if they logged out when they close the workbook but my code is not working...

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Sheets("OD&D Log-in").Select
If Range("H5") = "reconcile" Then
a = MsgBox("Do you want to Log-Out?", _
vbYesNo)
If a = vbNo Then Cancel = True
If a = vbYes Then
Sheets("OD&D Log-in").Select
Else
Workbooks("Daily OSD Log (ver5).xls").Close SaveChanges = True
End Sub

View 9 Replies View Related

Disable User Ability To Close Workbook

Jan 25, 2007

I have a workbook that has a macro that needs to run before it is closed. I have a button on my sheet that runs that macro and then closes the sheet. Is there a way that I can disable the "X" at the top right hand of the workbook and force the user to close the workbook via my button?

View 3 Replies View Related

Allow User To Restart Macro Or Close Workbook

Jun 25, 2008

I have a macro that runs when the workbook opens. At the end of my macro I've added a Yes/No box. If 'No' the workbook closes without saving. If 'Yes' I would like to restart the macro. I can close it ok, but I don't know how to restart the macro from line 1 when 'Yes' is selected. Here is what I have:

YesNo = MsgBox("Done! Would you like to run again?", vbYesNo + vbCritical, "Caution")
Select Case YesNo
Case vbYes

'I don't know what to put here :(

Case vbNo
ActiveWorkbook.Close savechanges:=False
End Select

View 3 Replies View Related

Remove Toolbars Upon Open/Re-instate Upon Close

Aug 19, 2006

Is it possible to use a function that removes all toolbars upon opening the workbook and reinstates the same upon closing, the work book i am currently using does the following as described in the code. however the function is limited in that only toolbars stated in the code will be removed, if for instance there was an adobe toolbar, that remains on the screen. or is there a better way of going about this? On open:

Private Sub Workbook_Open()
Run ("CreatePReturn")
Run ("CreateProceed")
With Application
.CommandBars(" Formatting").Visible = False
.CommandBars("Standard").Visible = False
.CommandBars("Drawing").Visible = False
.CommandBars("Return").Visible = False
.CommandBars("Proceed").Visible = False
.CommandBars("Worksheet Menu Bar").Enabled = False
.CommandBars(" Chart Menu Bar").Enabled = False
.DisplayFormulaBar = False
.DisplayStatusBar = False
End With
With ActiveWindow
.DisplayHeadings = False
.DisplayHorizontalScrollBar = False
.DisplayVerticalScrollBar = False
.DisplayWorkbookTabs = False
End With.................................

View 4 Replies View Related

Remove X Close On UserForm. Multiple Versions

Mar 2, 2008

I've found a link on OzGrid "How to remove the (X) CloseButton from Userforms" but I can't seem to get it to work with Excel 2003. The code looks like it was written for Excel '95, '97 and 2000.

View 6 Replies View Related

Automatically Close If A User Is Inactive For A Period Of Time.

Nov 13, 2008

We have one shared excel workbook and it is used by many people (more than 20 simultaneously), is there any way to auto save & close the workbook (session) if a user is inactive for specified time.

View 2 Replies View Related

Message Box To Pop Up Every 10 Mins Or So Prompting The User To Close The Workbook

Oct 13, 2008

how do i go about setting a message box to pop up every 10 mins or so prompting the user to close the workbook.? i want it to be as irritating as possible! iv'e had a look at ontime but cant get my brain into gear!also don't some of these timers fire even if workbook closed?

View 4 Replies View Related

User Forms- Create A User Form That Will "pop Up"

Oct 25, 2007

I have a spreadsheet with the following headings:

A
Claims Number

B
Name

C
Scheme

D
Admin

E
Date

I need to create a user form that will "pop up" and ask the administrator to enter the above details.

A - should be created automatically (ie last claim number + 1)
B - user enters manually
C - data retrieved from a list
D - data retrieved from a list
E - date is the date the information is entered

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved