Stopping User Saving Unless Condition Met.

Mar 6, 2008

I am looking to stop the user saving the sheet if certain fields are not complete.

The sheet has headers on line 4 and runs from A4 to M500

In the M cells there is a counta function to check the records are complete.

M4:M500 shows either

Complete - All records comlpete
Incomplete - something missing
Blank - nothing entered yet.

What i want to do is, if one of the cells in M shows incomplete not allow them to save the sheet until its complete.

I tried the folowing (was my attempt to modify another post)

View 10 Replies


ADVERTISEMENT

Stopping User From Typing In Textbox

Jul 4, 2009

I have a textbox in a user form that I'm using as a way for someone to view what I've written but not for them to write in. Is there a way to easily disable them from writing in the text box?

View 2 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

Saving User Inputted Data From A Worksheet To Another Worksheet And Saving It

Jan 7, 2009

I have created a form in a worksheet which I have added questions too and then locked all cells except the ones where I want the answers in.

I have then added a button to the bottom of the sheet called "Print and Save". This work sheet is called "form"

On a second sheet called "database", I have all the titles of the questions running from a -> k and nother else.

What I want to happen is the user input the information on "form" into the boxes available. Once they have completed the questions, I want them to be able to click on "Print and Save" so that firstly the page "form" prints, and then for all of the answers to be saved in "database" below the titles for each question.

I have had a play, but just don't know where to start. Also, once there is a row of questions below the titles, I don't want it to overwrite information already there, it needs to go onto the next empty row available.

Attached is my excel file.

You will see in the code that I have the code for printing.. I just found this on the net and it seems to work fine for me.

View 9 Replies View Related

Prevent Saving Of Excel If Certain Condition Not Fulfill?

Feb 7, 2014

I want this statement translated into a macro.

Do not save file year.xlms if total of column N in sheetR does not match with total of column O in that sheet. I also want a msgbox if this happens.

View 4 Replies View Related

Saving User Based Data?

Jan 1, 2014

I am working on a project in which I used a formula and created a kind of a software.what I need to do is that after my user enters certain data it is sent to a worksheet(as directed).now I want that data to remain saved there even when I am changing the inputs in the formula. what is happening is that my previous data is getting erased when I enter new variables to the formula .

View 1 Replies View Related

Preventing A User From Saving A Workbook

Apr 10, 2008

if it is possible to prevent a workbook from being saved other than by a macro (So no saves on Ctrl + S or File Saves). Basically, I want to allow users to use a template that I have set up, but I do not want to allow them to be able to save the document.

View 9 Replies View Related

Template Excel File - Stop User From Saving

Oct 3, 2008

I have a template excel file that is loaded with macros. When the file is opened, a userform opens and the user makes several different selections. Based on the selections, the excel file is populated with information and pictures. I want to make sure that the user does not accidentally save over the template file when he/she is finished with the document.

My original solution was: when the user opened the excel file, it would automatically save under a different name in a temporary location. This would stop the user from being able to overwrite the source file. The users were not happy because the excel file is very large and takes a long time to save.

on another method to stop the user from overwriting the source file? using code? or another method?

View 9 Replies View Related

User To Select Variable Folder For Saving Files

Jun 11, 2009

I would like my macro to prompt the user to select a folder for files to be either opened from or saved to during the running of my macro.

In fact, I need them to select two folders, one for this month and the other for last month.

I think I need to set the two folders as a variable but being fairly new to vba I'm not quite sure how to do this.

View 9 Replies View Related

User Forms Saving Items Entered To Memory

Feb 16, 2010

Is there a way to save items into memory to be recalled in userforms.

Let's assume that I have a userform called UserForm1 and three textboxes named TextBox1, TextBox2 and TextBox3.

View 9 Replies View Related

Non Stopping Do Loop

Jul 12, 2006

how to quit this Do and For loop:

This simple coding should repeat this four times:
first ask user to input data in Textbox2.Text and then Textbox3.Text until user presses Cancel. --> x 4

But it don't seem to exit the Do Loop

For j = 1 To 4

i = 1

Data1 = TextBox2.Text
Cells(i, j).Value = Data1

Do

n2 = TextBox3.Text

If Cells(i, j).Value <> "" Then
Do
i = i + 1
Loop Until Cells(i, j).Value = ""
End If

View 7 Replies View Related

Stopping A Macro

Mar 22, 2007

In my main macro I have a line that makes it jump into a timer subroutine that starts the main macro every 30 seconds. However, I also have a line in the main macro that makes it jump into another subroutine at 2pm everyday that sends out emails. The problem is that if the timer starts the main macro again before the sending emails subroutine finishes, then it will only finish sending a portion of the emails before it jumps back into the main macro. Is there any way to stop my main macro once it recognizes that it needs to jump into the email sending subroutine, or a way to at least stop the timer subroutine?

the part of my code the jump into the sending emails subroutine and the timer subroutine look like this so far:

If timevalue(now()) >= timevalue("14:00:00") And timevalue(now()) < timevalue("14:00:31") _
Then DAILY_REPORT
End If
StartTimer

View 4 Replies View Related

Stopping Screen Movement

Jan 8, 2009

A good number of years ago I used a line of code at the beginning and the end of a macro to keep the spreadsheet from moving until the macro was finished. At the close it moved if a movement was necessary.

View 6 Replies View Related

Stopping Sheet From Printing?

Oct 4, 2011

how do i stop a sheet from being printed and add an error message/ dialogue box saying this sheet cannot be printed, view only etc etc. this to appear when they goto the print option in the menus.

View 5 Replies View Related

Cursor Not Stopping While TAB Action?

Aug 24, 2012

I have a for which consists of

2textbox
1 listbox
1 textbox.

While entering the data, the cursor does not stop in the list box and goes directly goes to the next textbox. Autotab is set to true.

View 4 Replies View Related

Stopping Conditional Formatting?

Jul 20, 2014

I am using a code to transfer data from one sheet to another using the VBA below. The only problem I am having is it is copying the conditional formatting as well which I don't want it to do as it is already set up in the sheet it is copying to. How can I stop this?

Code:
Sub MONTHLY_UPDATE_TextBox2_Click()Dim rRehab As Long, i As Long
Dim wsRehab As Worksheet
Set wsRehab = Worksheets("AUG")

[Code]....

View 3 Replies View Related

Breakpoint Is Not Stopping Code

Dec 21, 2007

I have event procedures for the following form events: Before update, After Update, On Open, On Load and On Activate and I have added a breakpoint to every event.

However, despite breakpoints in all these pieces of code the form opens and closes without the code stopping to allow me to debug by manually stepping through the code.

Have I done something fundamentally wrong, I'm still a newbie at VBA?

View 9 Replies View Related

Stopping A Loop Once Value Found

Oct 4, 2009

I have written the macro;

Sub
For i = 2 To FinalRow

If Cells(i, 1).Value = Range("A1") Then
Cells(i, 1).Select

End If
Next i

End Sub

And I was wondering if there was a way to end the Sub as soon as it gets to the Cell with the “A1” value in it as opposed to just continuing through all the rows to the end of the sheet even after the right value has been found?

View 9 Replies View Related

Application.OnTime Not Stopping

Nov 3, 2006

I am running a timer in XL using the Application .OnTime Method.

Everywhere I've looked tells me that the procedure to stop the timer is

Sub StopTimer()
On Error Resume Next
Application.OnTime earliesttime:=RunWhen, procedure:=cRunWhat, schedule:=False
End Sub

I have this code in with the timer, but when I hit F5 or go to Tools--->Macros--> and Run the StopTimer Macro the timer just keeps running.

how I can properly call this procedure and stop the timer?

View 9 Replies View Related

Stopping An Endless Loop

Dec 21, 2006

I have the following VBA in the attatched spreadsheet (seperated so I could upload)

The only problem that I have is that I cannot stop the loop, it constantly keeps going round in a circle.

What im wanting to do is when the Date checked is the End date and the End Time has been checked, to move onto the next row and do it again until it gets to row 40.

Sub Calculate()
Dim CellNo As Integer
Dim CurrentDate As Date
Dim StartDate As Date
Dim EndDate As Date
Dim theDate As String
Dim c As Range
Dim i As Integer
Dim addDate As Integer
Dim DaysHoursSick As Date
Dim StartWorkTime As Date
Dim EndWorkTime As Date
Dim endmarker As String

I've only got this VBA working really under Wednesday so I can make sure it is right before adding it onto the other dates,

View 4 Replies View Related

Application Ontime - Stopping It?

May 25, 2007

I'm using Application OnTime to fire a procedure every 30 mins. It works great, but the workbook tries to reopen itself when i close it (but not if i close excel entirely). I assume this is because I haven't stopped it anywhere. So I put a call to a procedure that has: Application.OnTime RunWhen, cRunWhat, , False

In the "Workbook_BeforeClose" event. This doesn't solve the problem. What am I missing?

Private Sub Workbook_BeforeClose(Cancel As Boolean)
StopTimer
End Sub

Private Sub Workbook_Open()
StartTimer
End Sub

(module1)

Public RunWhen As Double
Public Const cRunIntervalSeconds = 1800 ' thirty mins
Public Const cRunWhat = "dothis"...............................

View 8 Replies View Related

Saving A File Without Saving Macro

Jan 30, 2003

I have a spreadsheet that imports data, manipulates it then deletes 2 of the sheets then saves the file under a different name to the network. Is there any way to save this new worksheet without it storing the macros - so when the user open it, only the data is there and they get no prompt to enable macros?

View 6 Replies View Related

VBA Code Stopping On Autofliter Criteria?

Dec 10, 2013

Why I get a debug message on the following piece of code

[URL]

VB:
Sub Macro2() '
' Macro2 Macro
' Macrorecorded 10/12/2013 by nathajos
'

[Code].....

View 5 Replies View Related

Text To Columns Wizard - Stopping It

Jun 2, 2009

I am getting frustrated with the Text to Columns Wizard. After using it once on a spreadsheet, it continues to opperate whenever I paste.

Is there a way to stop it from automatically converting text to columns when I paste?

View 5 Replies View Related

Stopping Text From Repeating At The End Of Spreadsheet

Jan 20, 2009

I am trying to stop this code from re-occurring at the end of the spreadsheet. There are two constants that will always appear as text, one is "blank" and the other is "Grand Total". I would prefer to use "Blank" if possible. The spread sheet varies in size from day to day. I have a range right now in use up to A700. I did this because when I originally put in a column formula, it ran until 20000 + rows down. Can someone please provide me with a formula that stops this code once it reaches the bottom of my spread sheet?

View 2 Replies View Related

Stopping Screen Flicker Due To ComboBox

Jan 12, 2010

I'm having a problem with the screen flickering whenever a different cell is selected due to a ComboBox. I searched the forums and wasn't able to find any code that helped my problem. The fact that I wouldn't know where to insert the proper code to fix it even if I could find it doesn't help. That's why I assume the "optional code" listed at the end that I found online does not work properly because it probably isn't in the right spot. Here's the

View 12 Replies View Related

Stopping Formula To Automatically Calculate

Feb 20, 2009

Is there a way in which I can get excel not to run any formulas until I run some sort of command or click a button in order to tell it to?

For example, I have two sheets, one sheet has raw data entered manually into each cell, the other sheet has a large amount of formulas to calculate totals from this raw data. But every time a number is entered into a cell in the raw data sheet Excel says 'Calculating Cells', I want to be able to enter all my raw data, then go to my totals sheet and execute all my formulas.

View 5 Replies View Related

For Next Loop Not Stopping After Final Item

Jan 21, 2012

I've modified some code to perform a loop which creates a new worksheet for each item in a pivot table Page By field (EmpName), copying and pasting values for the displayed pivot table with each name selected. Everything is working fine until it gets done with the last item in the list, at which point I get a Run Time Error 1004, "Unable to Get Properties of the Worksheet Class".

I want the MsgBox to pop up at the end, stating how many sheets have been added.

Sub Loop_PivotItems()
'Turn off screen updating
Application.ScreenUpdating = False
'Store the sheet with the Pivot Table
Piv_Sht = ActiveSheet.Name
'Loop through every PivotItem in the PageField (Filter) of the Pivot Table

[Code] ...........

View 2 Replies View Related

Stopping Duplicate Sheet Names

Jul 17, 2008

I have a very simple userform that i'm using to allow users to name their 'location'

Private Sub CommandButton1_Click()
ActiveWorkbook.Unprotect
If Me.TextBox1.Value = "" Then
Beep
MsgBox "Please give your location a name"
TextBox1.SetFocus
Else
Sheets("Template").Visible = True
Sheets("Template").Copy Before:=Sheets(1)
ActiveSheet.Name = TextBox1.Value
Sheets("Template").Visible = False

ActiveWorkbook.Protect
Unload Location

End If

End Sub

As i'm sure you've already guessed, there is nothing stopping a user from trying to rename the new sheet with an existing name. Is there anyway of checking the entry and workbook for duplicated enteries?

View 9 Replies View Related

Stopping Cell References Changing

Jul 6, 2006

I have a cell which references another cell (i.e. =A2). When I insert a cell above A2 the new formula becomes =A3. How do I stop it from changing?

I want to insert as many cells as I want above A2 and the cell reference will always be =A2. I played around with $'s but to no avail.

View 5 Replies View Related







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