VBA If Range Value = Something AND Another Cell Has No Entry- Prompt The User To Enter Data- My Code Is Not Working

Apr 20, 2009

I am trying to display a message box for the user if there is "agency" in cell o8 but nothing in p8... I tried the following code but it doesnt work..


If Range("o8").Value = "Agency" And Range("p8").Value = "" Then

MsgBox "Please provide name of agency in cell p8"

Sheet9.Shapes("cross").Visible = True

Else

View 9 Replies


ADVERTISEMENT

Messagebox Prompt Then Allow User To Enter Data Before Continuing Code Execution

Jun 11, 2013

Basically, in the "Thisworkbook" code , i have some code in the Workbook_BeforeClose section. Currently , it autosaves the workbook in a folder i have specified.

However, i need to add some code.I want to check that a certain cell has a value in it before the user closes the workbook, and if the cell is empty, show a messagebox asking him to enter a value.

I know how to get a messagebox to pop up, the only thing is once the user clicks the OK button,
i need the rest of the code execution to pause, allowing him to make the change then if he clicks the "X" (top right of the screen) to close the file or application, the filesave dialog appears and he can then save the document.

how to go about this because at the moment when user clicks ok, the messagebox just disappears and filesave dialog appears and he doesn't have a chance to edit the cell.

View 5 Replies View Related

VBA - Prompt To Enter Data

Jan 15, 2007

After recording a macro that goes to last figure in data, how do I edit this to prompt for a new data value and enter it into 1st empty cell at end of data?

View 8 Replies View Related

VBA - Prompt To Enter Data

Jan 15, 2007

After recording a macro that goes to last figure in data, how do I edit this to prompt for a new data value and enter it into 1st empty cell at end of data?

View 6 Replies View Related

Prompt Users To Enter Information In Specific Range Of Cells Before Save

Mar 11, 2014

Is there a way to prompt users to enter information in a specific range of cells before they save?

View 1 Replies View Related

Prompt For Password On Cell Entry

May 22, 2008

I am trying to password protect user input on a specific text entry, for example if a user tries to enter the letter A they are prompted they require a password (I am trying to do this for authorisation.).

View 3 Replies View Related

Excel 2010 :: Data Validation - Restrict Value User Can Enter Into A Cell

Oct 2, 2012

I'm using Excel 2010, and I need to restrict the value the user can enter into a cell (E9).

In cell E3 is the screen width (pixels). eg 6024
In cell E5 is the preferred width of a window. eg 450

The user, in cell E9, enters an x coordinate for which they prefer the top left corner of the window whose width is specified in E5.

If the value that the user enters in E9, added to the width entered in E5, exceeds the value of E3, (if E9+E5 > E3) then the value should be disregarded (window will be off right of screen) and the user re-enter.

I'm not familiar with the use of data validation, so I'm uncertain as to how to use it in this circumstance.

View 3 Replies View Related

Prompt User For Folder, Import All Text Files & Replace In Range

Sep 2, 2009

Split From Run VBA Macro From Another Procedure. will it autosave and open all the archives in the file i specify and loop?

View 3 Replies View Related

Prompt User For Data To Pull

Oct 8, 2009

I'm building a spreadsheet that consolidates multiple worksheets into one. I've got that portion done, but what i need help with is a user prompt. I don't have an example at the moment, but it should be fairly straight forward.

Rather than consolidating all the data into one worksheet I want to consolidate only the rows that contain certain information. The column I need to query in each worksheet is "BL". The only thing is that column won't always contain the same data. Is there a way to do basically a prompt to where it searches for the data they want and if it isn't in there it just moves on to the next worksheet automatically?

View 9 Replies View Related

Macro To Pull Data From Multiple Files With User Prompt

May 2, 2008

I need a macro which collects data from two files and dumps it into a separate spreadsheet. I need it to prompt the user to select the two files, since the file names may change.

Once a user selects the files, the macro simply opens them, grabs the data (the data sits on a single sheet in each file) and pastes it into a file, and closes the 2 data files.

The Data sits in A7:N20 on both files.

View 14 Replies View Related

Excel 2003 :: Allow User To Enter Post Code And Some Details Will Be Returned Using VLookup?

May 8, 2013

I have produced a basic search/lookup facility on an Excel workbook that simply allows the user to enter a post code and some details will be returned using a vlookup. The document is going to be rolled out to a number of operational users so I want to basically 'lock down' everything I can in the document (basically everything except the data entry cell) and make it fool proof- I have locked all cells apart from the data entry cell and have made the file read only.

The only issue I am encountering is when the cursor is in the one 'unlocked' cell (i.e. the one the users will enter the post code into); it appears that you can break the document. For example, when the cursor is in the 'unlocked' cell, I am able to go to Tools > Options and change various settings including cosmetic colour changes but also cell calculation which breaks the lookup functionality. This is probably enabled as the cell is unlocked, but if I lock the cell, when I protect the document, it disables data entry!

if there is another way of providing this one cell for users to input data into for the vlookup to work whilst locking down the rest of the document to ensure that no-one can break it?

View 1 Replies View Related

Auto Entry Date When Enter Data?

May 28, 2014

What I want to do is if I add data into B7 or F7 then the current date will appear in J7. I also don't want the date to change every time the project is opened.

Thus,

If I enter "withdraw or any word" into B7 or F7 - The current date (4-Dec) would appear in J7.

then if I close excel and I open it tomorrow, J7 would still read as 4-Dec, while if I enter "deposit or any word" into B8 or F8, the current date (5-Dec) would appear in J8.

- would need to be able to enter multiple entries on one day as well.

- also i am not familiar regarding macros.

View 2 Replies View Related

Enter User Form Data Onto Spreadsheet

Oct 4, 2007

I have 4 textboxes that the user enters data. I then have a button on the user form.

i would like to write code so that when the user hits the button...
Textbox1 data goes into active cell
Textbox2 data into the cell below Active cell
Textbox3 below it
and textbox4 below it
then close the user form.

View 9 Replies View Related

Use One Template To Enter Data With Users Being Able To Start Entry From A Number Of Different Starting Points

Jul 30, 2009

We're trying to use one template to enter data with users being able to start entry from a number of different starting points. this changes they way the look-ups have to work. The attached sample explains it a whole lot better.

View 2 Replies View Related

Multiple User Data Entry?

Nov 4, 2012

We need to have various users input data into a spreadsheet, so I have created a userform. Just need some code with the submit button to populate the central sheet, I think that I will need it to open the sheet, paste the data, save and close it.

This is my submit button as it stands, with the form and spreadsheet in the same workbook:

Private Sub btnSubmit_Click()
Dim RowCount As Long
Dim ctl As Control
RowCount = Worksheets("Sheet1").Range("B1").CurrentRegion.Rows.Count
With Worksheets("Sheet1").Range("B1")
.Offset(RowCount, 0).Value = Me.coboPropSalutation.Value

[code]....

View 1 Replies View Related

Log UserName Of User On Data Entry

Dec 2, 2006

I have a spreadsheet where for traceability purposes, I get some vba to enter elsewhere on the sheet, the date and time that data is entered into a cell. Is it possible to also somehow capture the name of the person entering the data. We are on a network, so the pc does "know" which user is logged in.

View 8 Replies View Related

Prevent User To Enter Duplicate Using Data Validation?

Dec 27, 2013

I want to prevent user from entering duplicate text or numbers in a cell using the Data Validation.

View 9 Replies View Related

Multiple User Data Entry Form

Jun 28, 2007

Basically at the moment our static data group use a generic sheet which lists all possible field variables. However, what I want to do is design something which only shows the fields that need to be filled out (ie if the field is shown it needs to be input).

Once the form is filled out it will get saved and sent via email, where it is then printed out and input by our data group. One way I thought about approaching this was to have 18 sheets which are hidden, and which are then selected when a report type is filled out. The other way would be to have IF statements but I think that would get complicated on the one sheet. Just really looking at ideas at this stage.... For example there are 30 fields on the sheet that we use now, but some reports may only need 5 of these fields - I therefore need to "hide" the remaining 25...

View 6 Replies View Related

Forcing A User To Hard Enter Into A Cell

Apr 8, 2009

Is it possible to lock a cell so that the user must enter the number manually as opposed to using a formula.

There is a cell on one of our spreadsheets that the user should be hand entering the numbers from the general ledger this is done to ensure that the general ledger balance is the same as the spreadsheets totals. However most of the user insert a formula that just copies the number from above into this cell that should be hand entered.

View 9 Replies View Related

Enter Fixed Data Pattern Based On User Input

Jun 21, 2012

I've been going round in circles with this for hours and have got no-where. I 'm trying to get Excel to paste in a set pattern of data based on an input cell.

In row 1 I have months starting in cell B1. B1 = April 12, C1 = May 12, D1 = June 12, and so on

The user would enter the data in column A, starting in row 2

If the date in A2 = May 12 then Excel would enter 10 in cell C2, 20 in cell D2 and 30 in cell E2. If the date in A2 is changed to June 12, then the previous data would be cleared and Excel would enter 10 in E2, 20 in F2 and 30 in G2.

Date would be entered in A3, A4, A5 etc and I would want it to post the same fixed data depending on the date the user enters in teh relevant row.

I've tried IF statements and also some code but can't even get near it working.

View 9 Replies View Related

Dropdown List With Prompt Box To Enter Value And Hide Input

Feb 5, 2013

I am looking to allow a user to enter a unique value when a drop down value is captured from a list i.e 'Other' (Possibly a pop up box), then I require this value to be hidden and calculated along with others to show the average (The average calculation obviously wouldn't be in the same cell).

View 8 Replies View Related

Inscribing Cells: Run A Macro On Enter Keypress, That Would Execute Different Code Depending On That "inscription" That Would Be Invisible To User

Feb 20, 2007

Is there any way to "Inscribe" a cell? I would like to run a macro on Enter keypress, that would execute different code depending on that "inscription" that would be invisible to user. I could use some properties of . Validation property like this:

Private Sub EnterPressed
'following code to ensure proper functioning of Enter in any other Worksheet
If ActiveSheet <> mySheet 'MySheet is global Variable then
ActiveCell.Offset(1,0).Select
exit Sub
End If
'now the real code
If ActiveCell.Validation.InputMessage = "1" Then
ActiveCell.Offset(0,1).Select
Else
'something else
End If
End Sub

The problem is, I use Data Validation and Conditional Formatting, so can't use any of these properties.

View 8 Replies View Related

Fill Value In A Cell Based On User Entry

Mar 26, 2009

I have a dilemma.

1.I want to be able to a have a cell be filled with a certain value when the user enter data in Column C.

2.I know that this can be accomplished by a formula, but my spreadsheet will work my efficiently with a macro.

3.I do not know much about VBA but I believe that I will need a macro for each sheet that fills in the word.

View 6 Replies View Related

Submit Data Entry Into Protected Sheet Without Being Able To Edit By User?

Sep 26, 2012

I have created a simple userform that is linked to a button on sheet1. When the data in the userform is submitted, I set it up so it goes into a database under sheet2. The problem is, I don't want anyone modifying the entries in the database. Usually I would protect the sheet with a password, but when I do that, there is an error when the userform is submitted. The only thing I can think of is to hide sheet2, which doesn't seem like a great solution.

Is there any way to protect my database from being modified yet still allow the userform to be linked to it?

View 3 Replies View Related

Post To Different Sheets In Excel User Data Entry Form

May 27, 2014

User form data entry.

I need to save the data of For Eg. A form in Sheet 1, B form in Sheet 2, C form data entry in sheet 3.

what is happening now is that, all the entries are going in the Active Sheet that is open in the excel file. I want to automate the process of data entry, by making it enter data from specific form in specific sheet.

1st form

Code:
Private Sub CommandButton1_Click()
eRow = Sheet1.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Cells(eRow, 1) = ComboBox1.Text
Cells(eRow, 2) = TextBox12.Text
Cells(eRow, 3) = TextBox2.Text
Cells(eRow, 4) = TextBox3.Text
Cells(eRow, 5) = TextBox4.Text

Unload Me
ThisWorkbook.Save
End With
End Sub
2nd form

Code:
Private Sub CommandButton1_Click()
eRow = Sheet2.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
Cells(eRow, 1) = ComboBox1.Text
Cells(eRow, 2) = TextBox14.Text
Cells(eRow, 3) = TextBox2.Text
Cells(eRow, 4) = TextBox3.Text
Cells(eRow, 5) = TextBox4.Text
Unload Me
ThisWorkbook.Save
End Sub

View 2 Replies View Related

Prompt For File On External Formula Link Entry

Feb 1, 2008

I want to be able to get a value from a specific cell in another workbook, the problem i have is that i want to be able to select what file the active workbook looks for from the start page of my current workbook. For example when i load the workbook i get my startup page ( sheet 1) where i will be able to select what external workbook the active workbook will be linking with, i will then link the active workbook to the value in a specific cell from the selected external workbook.
I know to link to another workbook i would use ='[filename]sheet!cell

However i want to be able pull up a 'open file dialog box' which i select a file name which will be used as 'filename' in the formula above.

View 2 Replies View Related

VBA Re User Prompt

Oct 4, 2008

I have created an addin that runs several macros. To enable the user to undo any changes, I keep a backup prior to them using any of the macros in the form of a worksheet named back00xx. I want a prompt to be displayed to the user to remove these backups at the closing or saving of the file. The problem is that as an addin, how do I get it to display this prompt as the open workbook is not part of the addin.

Could one have a looping routine that is checking every xx min/sec to check if the current workbook contains any sheets starting back00

View 9 Replies View Related

Enter Array Formulas To Range Macro Code

Apr 23, 2008

I'm trying to enter a series of formulas referencing the first cell of each row.

With Range("A40")
Range(.Cells(1, 1), .End(xlDown)).Offset(0, 1).FormulaR1C1 = "= COUNTIF(Details!R2C2:R65536C2,RC1)"
Range(.Cells(1, 1), .End(xlDown)).Offset(0, 2).FormulaArray = "=RC[-1]-SUM((Details!R2C2:R65536C2=RC[-2])*('Details'!R2C11:R65536C11=RC1))"
Range(.Cells(1, 1), .End(xlDown)).Offset(0, 4).FormulaArray = "=SUM((Details!R2C2:R65536C2=RC1)*(Details!R2C4:R65536C4>TODAY()-7))"
Range(.Cells(1, 1), .End(xlDown)).Offset(0, 5).FormulaArray = "=RC[-1]-SUM((Details!R2C2:R65536C2=RC1)*(Details!R2C11:R65536C11=RC1)*(Details!R2C4:R65536C4>TODAY()-7))"
Range(.Cells(1, 1), .End(xlDown)).Offset(0, 7).FormulaArray = "=SUM((Details!R2C2:R65536C2=RC1)*(Details!R2C4:R65536C4>TODAY()-30))"
Range(.Cells(1, 1), .End(xlDown)).Offset(0, 8).FormulaArray = "=RC[-1]-SUM((Details!R2C2:R65536C2=RC1)*(Details!R2C11:R65536C11=RC1)*(Details!R2C4:R65536C4>TODAY()-30))"
End With

While this code works for the first formula, the following 4 are arrays, and for some reason, will only reference the first A40 cell.

View 9 Replies View Related

User Box Options If Cell Entry Is A Duplicate Found In A Table Column

Aug 23, 2009

I have a table that i use for a customer database. and the end user adds new customers to this table, what i would like is for a message box to pop up whenever cell B2 matches an entry in a column in the customers table. the table starts on row 25, and the column i would like to check for duplicates is column B. I would like the message box to give the user the message "A customer by this name already exists, Would you like to load this customers file?" If the answer is yes, then the row that the match was found on would be copied and pasted onto row 1. if the answer is no, then nothing else happens. I hope this makes sense, i am posting this sheet of my workbook for reference.

View 8 Replies View Related

Avoiding User From Inputting Duplicate Entry Into Single Cell In Excel

Dec 3, 2013

I have a worksheet in which i am asking a user to enter manually a number in cell E3. Suppose the user starts with 100, then the next time he is entering in E3 he shoudnt be able to enter 100 nor any number less than 100. I dont have a range for the numbers that the user is going to enter.Therefore countif function does not work. Is there any way that i an store the number taht the user enters first in cell E3 and then use that database to avoid the user from entering the same or a number lesser than that number.????

View 2 Replies View Related







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