Insert Data Validation By Vba

Jun 5, 2007

I want to insert data validation to a cell by VBA. When i record the macro to put a list (value1;value2;value3) to a Cell the following code is generated and the validation works OK.(dropdown of the 3 values)

Sub Validation_by_VBA()
Range("A2").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="value1;value2;value3"
.IgnoreBlank = True
.InCellDropdown = True
.InputTitle = ""
.ErrorTitle = ""
.InputMessage = ""
.ErrorMessage = ""
.ShowInput = True
.ShowError = True
End With
End Sub

If i run this code from VBA I have only one value in the dropdown (value1;value2;value3) How can i change this code so it will work from vba as well?

View 6 Replies


ADVERTISEMENT

Insert Data Validation Via Macro Code

Mar 1, 2008

I have written the below code to enter some formulas, validation, and formatting. I keep running into a problem when trying to add the first validation.
The debug msg is...

Run-time error '-2147417848 (80010108)':
Automation error
The Object invoked has disconnected from its clients.

Debug highlighted portion is...

.Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
xlBetween, Formula1:="=PRODUCT" ....................

View 9 Replies View Related

Insert Row Based On Data Validation List Choice

Aug 10, 2008

I'm working on a simple worksheet, it is a tracking sheet for programs taught. What I'm trying to find is a code to insert a row based on a Data Validation List.

Exampl of data:

Column A is for " Name" then futher down Column K is "Program Taught" and Column L is " Date Taught".

Column K is where the Data Validation List is located with a in cell drop down.

What I would like to do is when a user selects a program from Column K a row is inserted with all of the formulas and formats from the previous row, and upon insert would like it to copy Column A into the new row.

This would be so I can keep a historical of programs and dates taught.

And to really spice things up I want to lock Columns K & L of the previous row after the new row is inserted.

View 4 Replies View Related

Nested Data Validation: Figure A To Enforce Dual Data Validation On A Single Cell?

Aug 19, 2009

I'm trying to figure a to enforce dual data validation on a single cell. That is, I need to restrict the user to entering only a decimal value, only if a particular other cell (say A2) is blank. To put it another way, if A2 is blank, the user can enter a decimal value, but if A2 is not blank, the user cannot enter anything. I can use Data Validation to enforce either the decimal restriction or the ISBLANK, but I'm not sure how to make them work together.

View 2 Replies View Related

Data Validation Used To Create Separate Data Validation List

Feb 15, 2014

I have 2 columns First Name & Surname. What I want to do is create a data validation list on the surname which results in the 2nd data validation list only showing the first names which link to one of the surnames.

i.e. If I selected Smith in the 1st validation list then I would only like to see 'Paul' as an option in the 2nd list

First Name
Surname

Paul
Smith

Paul
Jones

Tony
Phillips

View 1 Replies View Related

Data Validation: Can I Use Data Validation In A Cell That Has Formulas In It?

Apr 3, 2009

I have attached a sheet that I am working on. I want cell G1 to be less than or equal to 165. That cell contains a formula. If the formula takes the number to over 165 the validation is allowing it.

View 2 Replies View Related

Data Validation :: Selected From 4 Validation Lists

Sep 26, 2007

I would like to know if it's possible to populate a data validation list based on what is selected from 4 validation lists?

for example:
On sheet1:
If 'Group1' is selected from data validation list1 then data validation list5 will show a list of all items from Group1. If 'Group2' is selected from data validation list2, then data validation list5 will display all the items in 'Group2'...

(I do not want to use a combo box for this)

View 9 Replies View Related

Data Validation - Add Some More If / Else But Validation Don't Allows It?

Jun 30, 2014

I had some of values in Column A, B & C for ex: column A has brand name, column B has model name and Column C has sub_model name here i have a limited values i need to make it as drop down list but i had a problem with the below formula.

=IF($F$2=Sheet2!$H$2,al_v,IF($F$2=Sheet2!$H$3,am_v,IF($F$2=Sheet2!$H$4,au_v,IF($F$2=Sheet2!$H$5,be_v,
IF($F$2=Sheet2!$H$6,bmw_v,IF($F$2=Sheet2!$H$7,bg_v,IF($F$2=Sheet2!$H$8,cv_v,I
F($F$2=Sheet2!$H$9,ch_v,IF($F$2=Sheet2!$H$9,ch_v,"")))))))))

i need to add some more ifelse but the validation don't allows it.

View 2 Replies View Related

Data Validation - How To Create Dropdown List That Excludes Duplicate Data

Sep 26, 2013

I'd like to create a drop down list in data validation from a column of data that contains numerous duplicates.

For example, let's say column A contained hundreds of transactions with either North, South, East and West, how could I create a drop down list in another cell that only had four selection options?

View 5 Replies View Related

How To Use INDEX Formula In Conjunction With Data Validation To Output Data

Jan 9, 2014

Essentially, I would like a user to be able to select a PUB from the Data Validation drop down in row 2 of the PUB RATES sheet so that the corresponding information in the DATA sheet autofills.

Currently, this works only for the first column under each PUB when selected and this fills across all 4 columns (rather than the respective information for each column filling).

Also, the Data Validation dropdown includes blanks which I would like to exclude.

I have used a Range Name for the Data Validation of each PUB so that these can be drawn from a separate sheet as I don't want all the DATA content on the same sheet as the PUB RATES content.

View 4 Replies View Related

Load Rows Data On Selection Of Data Validation List

May 28, 2014

I want to load the actual data exist in the rows by selection value from the data validation list.

E.g I have two worksheet in one excel file. One has a data activities of persons with their name like two columns i have in which one exist the name of person and second exist the activities which they perform.

On the second sheet, i made a data validation list of all the person names

Now my requirement is, when i select a person name from the list, load all the data from the 1st sheet to second sheet. Is this possible without VB code, because I want to share it on the Google sheet with my boss, where VB sheet is not supposed to work.

View 13 Replies View Related

Use Data Validation That Will Pull Data From A Source List

Jan 12, 2010

Is there a way to use Data Validation that will pull data from a source list and also be able to type in additional data or just new data in same cell?

View 3 Replies View Related

Data Validation; Get All The Data Row Wise For The Name Selected In The Drop Down

Jul 27, 2009

I have a excel sheet with values correcponsing few names. I have a list for a Data Validation drop down. How to get all the data row wise for the name selected in the drop down.

View 3 Replies View Related

Allow User To Automatically Add Data To Data Validation List

Oct 27, 2009

I am trying to learn the concepts, then apply them to a set of actual worksheets. I am trying to use named ranges from one worksheet in another worksheet. The named ranges need to expand. Although I can get the add data to a dummy worksheet to work within the same worksheet and I can even get a named range to work in the foreign sheet.

My problem is, when I can end up adding the additional data to the named range, it will only add one name. I have a number of named ranges that are referenced on various worksheets. The idea is, certain named ranges should be able to expand so I donft have to type them all in. (There could be hundreds of manufacturers or models.) I would also like them to be able to sort themselves after additional names are added to the named ranges. I would also like them to auto populate as well. I am using Excel 2003 SP3 (11.8307.8221). I have enclosed the file. Drop down lists (named ranges) are on the worksheet called DROP DOWN LISTS (LOCKED) **ITfS NOT CURRENTLY LOCKED**.

The data validation issues are on the worksheet called Rev7.0 Wood (Basic Sheet.) There are other instances to use these, but I hope to learn to do them myself on the other worksheets. Of particular interest is Column f.................

View 3 Replies View Related

Data Validation List: Ignore Blanks Between Data

Nov 1, 2006

In column A I have a list of text. There are blank lines in between the cell that actually contain text. What I am trying to accomplish is create a validation list that will give me only the cells with text in them and ignore the blanks. For example in column A1:A7 I have the following text:

John
Mike

Tony

Jake

My validation list will return those names but will also give me the blanks in between the names.

Is there any way to ignore the blanks?

View 4 Replies View Related

External Web Data Query Fails To Insert Table Data?

Jul 9, 2014

An external data web query points to a web site that offers a foreign exchange rate calculator. In my browser, I selected the specific currency pair I need and used the resulting url in the web query. The "New Web Query" pane resolves the url correctly and allows me to select the table data I want (the little yellow arrow turns to a green check mark). However, when I hit "Import" and select the target cell, the only data returned is the parameters from the url and an error msg (This web query returned no data...). How do I get the query to pass the parameters to the website correctly?

View 3 Replies View Related

Data Validation Rules Not Moving With Data

Feb 24, 2014

creating a spreadsheet for work which is almost working a treat Unfortunately, when a row of data moves from one sheet (Queries) to another (Archive), data validation is lost. Initially I thought I daidn't have it set up on the Archive sheet, but on moving it back to queries (by use of a macro) the validation is still not working. how to keep validation rules WITH data when it is moved please? I will upload my file when I get home from work....network restrictions prevent me doing it here!

View 8 Replies View Related

Data Validation List With Changing Data

Jun 3, 2009

I would like to utilize data validation to create a drop down list from a list of 100 rows that changes monthly. Currently the list is set to draw data from A1:A100, however depending on the month, different cells will have data in them. What I don't like is currently the blank cells create gaps in the data validation drop down list and make it longer than it needs to be. Is there any way for excel to automatically just display cells with data in them in the drop down?

View 9 Replies View Related

Data Validation :: Limit The Data Available On The List

Jun 28, 2009

have created a list obx using data validation. My question is, is there a way to limit the data available on the list.

Example: sheet 1
A1 A2 A3
Address A
address p
address s Date

Sheet 2
has data validation list that consists of all of A1 a named range called "address". Everything works great.
I now want to be able to limit the available choices in the list depending on what cell the user is in

example: if user is in sheet2 a1, i only want them to be able to pick address that have an "A" or "p" in cell A2 on sheet 1

I tried to acomplish this using conditional formatting, I format my named range with different colors, but the colors do not carry over to the data validation list on sheet2.

View 9 Replies View Related

Creating A Data Form With Data Validation

Sep 15, 2006

I have limited ability with Excel, and I'm trying to create a database using the Data/Form menu choices. My problem is I only want specific data in two of the 20 or so fields. When I use Data/ Validation and direct data entry, I get exactly what I want, EXCEPT that the choices don't come up when I use the Data/Form. Users can enter anything they want, which defeats the purpose. I tried to build a user form to use for data entry, but I don't know how to get it to add items to a database or lookup items like the data/form process does. I also want to add a few macro buttons to the form to do other things.

I am pretty sure of a few things: 1) This should be pretty simple. Anyone knowing VBA would probably know how to do this in minutes. I found some code that did a simliar function, but couldn't interpret it to fit my needs, which brings me to 2) I'll never use VBA or complicated macros again. I don't have the need for them. This is just an isolated incident. Therefore, signing up for a class would be useless to me. I tried to locate some advanced Excel/VBA classes, hoping to find an instructor or even a student who would welcome a simple challenge, but there are none available.

View 5 Replies View Related

Data Validation Multiple Columns Data

Apr 17, 2007

about data validation drop downs.

I have 2 columns that need to be filled in once a name is selected from the data validation drop down. The data is to the right of the name in the source area.

Column A Column B Column C
1 Name 1 Skill 1 Phone #
2
3
4

This is the format, Every row in Column A has a Data Validation Drop Down, I need Column B and C filled with Data from the selected name from Column D (the data columns D-F)

Column D Column E Column F
1 Name 1 7 555-1111
2 Name 2 5 555-2222
3 Name 3 3 555-3333
4 Name 4 4 555-4444

So when I select say name 3...

Column A Column B Column C
1 Name 3 3 555-3333
2
3
4

View 3 Replies View Related

Data Validation ..

Mar 26, 2008

I want to add a validation list to a spread sheet using a named ranged. Easy enough so far, but if the range only has two values which are repeated several (hundred) times - Yes & No - how can i stop the value appearing on the list more than once?

I'm open to other suggestions with this such as using list boxes etc, just so long as i can get around it without having to maintain a seperate spreadsheet of the values i would like to appear in my list.

View 9 Replies View Related

Data Validation Min And Max

Jul 27, 2009

I have a valve in A1 of 5
I have a value in A2 of 1
I have a value in A3 of 2

In cell A4 using data validation
Min formula=IF(AND(A1=5,A4>=A3),)
Max formula IF(AND(A1=5,A4

View 9 Replies View Related

Is Data Validation The Way To Go

Feb 26, 2010

I have 2 sheets in a workbook. The first sheet is 'working loads' and the second is 'completed loads'. I enter data into the 'working loads' sheet. When that row of data is completed, I mark a x into the 'completed' column, when I put the 'x' into that column it sends that row of data over to the 'completed loads' sheet.

This is my problem, when I enter data into the 'working loads' sheet into the 'Bill to" column, because it is not restricted it can be entered any way the user decides to enter it. When it goes to the 'completed' sheet, the 'bill to' is entered in 2 or 3 ways depending on how the user entered it in the beginning on the 'working loads' sheet.

I want the user to be restricted on how the data is entered on the 'working loads' sheet so that I don't end up with the 2 or 3 ways it was entered for the same client on the 'completed loads' sheet. I also need to add to the the list if it has not been used in the 'bill to' info as we get new clients weekly.

I currently am physically changing the 'bill to' info on the 'completed loads' sheet manually so that the client is entered only once, but as the year goes on the list grows as I might have 5000 rows of data with the same client entered 2 or 3 different ways.

View 9 Replies View Related

Score Using Data Validation?

Mar 16, 2005

I am using data validation for a drop down list e.g Good, Average, None. What i want is when a user selects for example "Good" i need a score to be automatically entered into another cell so that i can then do some calculations.

View 2 Replies View Related

Data Validation Without Duplicates

Jan 7, 2014

I have alist in which a location is mentioned multiple time..

eg:

Delhi
Delhi
Delhi
Punjab
Punjab
Mumbai
Mumbai

I need a data validation in which a location should come only once...

View 7 Replies View Related

Getting Total If Using Data Validation

Jan 28, 2014

I am creating a worksheet as we have collect client satisfaction surveys. I have created a worksheet with each question at the top of the columns and the answer (yes or no) with data validation. I input each survey into a new row. I now would like to total how many people answered Yes and how many answered No. What formula can I use to total the answers?

View 6 Replies View Related

Data Validation With VLookUp?

Jul 18, 2014

I have the following sitation:

xls Sheet 2
ITEM EQUIPMENT
1234 a
1234 b
5678 c
5678 d

xls Sheet 1
PO ITEM EQUIPMENT
56 1234 **
99 5678 **

** in the equipment cell of sheeet 1 I want a drop down (data validation) with the possible equipment I can use forthis item only. I.e. for PO 56 Item 1234 only the equipment a & b should be in the drop down menu.

View 12 Replies View Related

Data Validation, Drop-down Box

Oct 6, 2008

I want to do couple of things here.
1. put an empty field in a drop down box. If possible the empty field should be at the top from the drop down menu.
2. Update names in drop down box when I add names to the list

View 8 Replies View Related

Data Validation From Another Worksheet

Oct 8, 2008

I would like to impose data validation on Sheet1 row A. I have a list of values in Sheet2 row A. Is their an easy way to do this?

View 3 Replies View Related







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