Create Error Message When Two Columns In The Same Row Are Used?
Mar 26, 2014
I'm trying to create a situation where the user would get an error message when they tried to enter numbers in two specific columns in the same row. That is, in row C they can only enter a number ( 1 or 2) into C5, C6 or C7. If they enter a number into two of these cells, I want an error to appear. They would have to stop and correct the error.
I've tried two scenarios with no luck:
1. I've data validation where I did SUM(C5:C7) and hid the answer in C8. I then tried to get a data validation to display an error code when C8 exceed 2. This didn't work.
I'm sure this query has been answered somewhere else but I can't seem to find it. I basically have information in two worksheets in the same workbook which need to be compared and the missing values from one worksheet need to be listed in a message. There are duplicate values in both worksheets so only need a list of the unique missing values. For example:
Sheet1 Column A 1 2 1 5 5 2 3 5 4
Sheet2 Column A 2 3 3 4 3 4
The message box should state that we are missing 1 and 5 from the dataset as it is not in Sheet2. If the list could be sorted in ascending order that would be great too.
I am looking for a more efficient way to write a macro (a sample from the macro is below). This is just the first part of the macro. I need to repeat these same steps (seen for row 5 below) for rows 5 to 50. My script worked until I hit row 35 and then I got the "compile error.." message. There must be a way to use "loop" to write this more efficiently, no?
Is is possible to create a message box that will have an option to "do not display this message again" that will reset the button each time the workbook is opened?
For some reason my form won't open when the workbook is opened. I get an error message "run time error '424' object required" (which happens when I have Form1.show in the BOTH workbook_open event and the userform_initialize event (oops)). When I removed form1.show from the userform_initialize I don't get an error but I also get no form. I recall having this issue before but I can't recall how to fix it.
Can I call the userform_initialize event from the workbook open event to get around this successfully and properly?
I do hit the SCE (Shift-CTRL-Enter) keys. The formula does work in one workbook, but not the other. The only difference between the two workbooks is this formula has a larger range.
New Formula- doesn't work (ERROR- #DIV/0!) {=AVERAGE(IF(Sheet1!A3:A1094="MONDAY",Sheet1!E3:E1094))}
Old Formula- works {=AVERAGE(IF(B6:B451="MONDAY",E6:E451))}
I'm looking for a way to prompt outlook to create a new email and in the body copy the contents of Sheet1, but instead of sending, I want it to just hold it so that the user can review the email contents.
Similar to this, but instead of an attachment the email body contains the data from sheet1
I have two question for Excel in combination with microsoft outlook:
1. I was wondering if it is possible to create an email from Excel which automatically adds the From-field with a pre-defined emailadres. I am using CreateObject("Outlook.Application"), but I can not add the From-field.
2. I also would like to know if it is possible to do automatically fill the To-field with the emailadress from the user who send me the original file. Maybe this needs some more explanation (sorry my english isnt too good):
* A user can download an excel-form from the internet * The form is sent to my emailadress * I give a number to the form * The user will get a message that his question is attend to with the number of the question
So I use a macro-button to reply when I have filled in the question-number.
I get spreadsheets sent to me with hours and minutes in decimal format. Frequently a quarter of an hour or three quarters of an hour are posted as 0.15 or 0.45 instead of 0.25 and 0.75. Other odd fractions can also appear.
I want an error message if the value when divisible by 0.25 is not a whole number.
I wanted to make a pop up alert message appear whenever the formula in a cell gives a particular output.
Before posting this i tried looking for similar posts before, but the ones found do not solve my problem. There it asks me to write the following code in VBA,
Private Sub Worksheet_Change(ByVal Target As Range) Dim MyRange As String
MyRange = "A1"
If Me.Range(MyRange).Value = "Have Meeting" Then MsgBox "Have Meeting" End If End Sub
But my doing so, I can not use any formula in the cell A1 or any other cell i give reference as MyRange. I will always have to physically type "Have Meeting" or any other word assigned in the above.
I am writing some code to do a comparison between two cells X2 or AB2 with an X which checks to: 1. make sure one of the two are filled, or 2. both are not filled. Below is an extract of the spreadsheet I am working on. I need to check to make sure one of the boxes is checked. If both are empty or both filled with an ("X"), I want a message box to tell me to correct the error and stop the macro from continuing. If only one is marked with an ("X"), I want the macro to continue but don't know how.
I am receiving an #Value! error message from my sumproduct formula: =SUMPRODUCT((Data!$A$2:$A$47=G$2)*(Data!$B$2:$B$47=G$4)*(Data!$A$1:$N$1=$B21)*(Data!$A$2:$N$47))
As follows: Data!$A$2:$A$47 is a date G$2 is a date within the context
Data!$B$2:$B$47 is a unit number G$4 is a unit number within the context
Data!$A$1:$N$1 are descriptive titles $B21 is a decriptive string within the same context (copy paste)
Data!$A$2:$N$47 are to be summed is all criteria are met.
I have a vba code that I wrote out to search for a file and update data on a spreadsheet with the new file... however I've come to a point where I'm not sure of what code to use. If I search for a file that is not there I get a runtime error and of course it ask me to end or debug. What I would like for it to do instead is search for the file and if it is not there... display a message box stating that the file searched for is not found and automatically closes the workbook after OK is pressed.
I've got the below code which I use to log users who opens my spreadsheet. It's a Event so runs when the spreadsheet is open with macro enabled. The spreadsheet is on a shared drive which has the prefix "K". Most users it works find but one user gets a error Message "Path or Drive" error. I got around it by adding "on error" but how do you overcome issues with drive prefixs and the drive address e.g "K" vs "\CRD2000"
Private Sub Workbook_Open() Open ThisWorkbook.Path & "usage.log" For Append As #1 Print #1, Application.UserName, Now Close #1 End Sub
I have developed a program in which the user will only see the userforms (and to an certain extent not even be aware of excel doing most of the work).
i am looking for code that will intercept an error message should something go wrong in my vb code. Currently when an error occurs, it pops back to VB and gives the error message. I want it to rather give a popoup message asking the user to contact me.
i'm coping a file over itself and i get an information message "File cannot be copied onto itself" - An attempt to copy a file could not be completed because the file already exists or same source and destination.
i would like to surpress this, i have tried the following, but to no avail:
I have created a report with 22 sheets as different pages to be included or hidden depending upon the type of report needed. I had found several sources saying to use the Custom Views function. So for example I will unhide all the sheets and add as a Custom View "All Sheets" and then whittle it down to the 5 I might need for B type inspections and add that view as B Inspection. But when I try and toggle between them I'm getting an error message that says "Some view settings could not be applied" - and thew saved view I was looking for is not the same sheetwise.
I may be misunderstanding the point of error.type() command. I'm wanting an error message to appear once a cell goes below 0. So far, I've only managed to have the error message appear all the time, or never.
I need to write a formula but excel shows an error message "Formula Too Long." There are two long strings of the formula that I repeat several times. Is there any way to put these strings in other cells and reference them within the formula? Each of the strings looks very similar to this:
How do you generate an error message that states "You are not authorized to delete this worksheet" any time a user attempts to delete the specified worksheet? This message also has to block the user for deleting the worksheet.
I need a program for my user form such that it displays an error message. I have created an user form with employee name ,task and remarks.
I need a program in such a way if an user clicks the "submit" button without entering all the fields in the user form, an "error message" should be displayed.
The submit button has to work only if all the fields are filled by the user.