Home / Normal girls on cam / Macros for validating data in excel

Macros for validating data in excel

Cadamhill, I'm using the data entry form on a data list that I just created, all in a recent version of Excel.I can't tell you which version, because I can't locate the Help / About or wherever it currently displays the version number. If the default data entry form doesn't do drop-down lists, I will need to create a custom form.Either way, it would be possible to circumvent the these "security" measures to see others passwords. password=inputbox("Enter Password") 'For Dave If password="QWERTY" Then MACRO TO RUN Else Msgbox("Password Incorrect") Exit Sub End if 'For John If password="12345" Then MACRO TO RUN Else Msgbox("Password Incorrect") Exit Sub End if This is very inefficient code that you'll probably want to structure differently, but hopefully you get the idea. I might suggest that you put the password list somewhere (either directly in the code or on a hidden sheet) and then use a FOR loop, or other such construct, to match the password. There are other ways to do it, so we can keep exploring if this isn't what you want. I've set up the data list on one worksheet, with data validation referring to lists of values on a second worksheet.One possibility would be to have an input box for the password and then match the name and the password to a master list.

If the result of this sum is equal to zero, I would like the cell to be blank.The code disables the user from using the Close Box on the title bar. Alright, here is my situation: I have two pivot charts in a workbook, Chart A and Chart B (on separate sheets... Under each chart is a data validation drop-down menu with years listed in them (2010-2020). Enable Events = false 'your Select case code here 'add this at the end Application. _);_(@_)" If Return Sheet = "VP Mfg Group Chart" Then Sheets("DCS Mfg Chart"). Value = 2010 Else If Return Sheet = "DCS Mfg Chart" Then Sheets("VP Mfg Group Chart"). So the question is (and sorry for being so long winded), is there a way to make both drop-down menus update without calling the macro over and over again? -Sean Private Sub Workbook_Sheet Change(By Val Sh As Object, By Val Target As Range) 'add this at the beginning Application.Selecting a year in the menu activates a macro which changes the information displayed for the given year. I'd like to write the macros so that the information in BOTH charts changes, even though an item from only one of the two menus is selected. I'd like to make it so that BOTH drop-down menus update. The example uses a User Form, a Combo Box, and a Command Button.You can change the names and the loading of the Combo Box to match your needs.Is there a way to validate data typed into the user form?I tried validating the actual cells that the data adds to, and that didn't work.

911 comments

  1. Use Ford's data to validate the QI Macros Gage R&R Template for Excel. Download 30 day trial.

Leave a Reply

Your email address will not be published. Required fields are marked *

*