Copy Validation From One Range To Another
Nov 13, 2006
how to fix the following? The variables are predefined, the syntax for copying the validation is incorrect.
Range(P1start, P1start.End(xlToRight)).Validation.Type = P1input.Validation.Type
Range(P1start, P1start.End(xlToRight)).Validation.Formula1 = P1input.Validation.Formula1
View 8 Replies
ADVERTISEMENT
Mar 3, 2013
I'm trying to set up a spreadsheet for users to update with details of customer service problems. A few of the columns have data validation against them (the master lists are on another worksheet) but I want to be able to copy the validation to a new row when created.
I've found this macro which seems to do the trick in terms of creating a row and copying the validation - but there's a couple of things that I'd like to amend...
VB:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim LR As Integer
If Target.Column > 1 Then Exit Sub
[Code].....
Firstly, I want to be able to create a new row above what was entered previously. The macro works fine as it is, but as the spreadsheet grows and grows, I don't want users to have to scroll down to the bottom of masses of information. I'd rather have it so that every time a user double clicks in cell A2, the data shifts down but the validation that was in row 2 remains in row 2.
Also, at present in the macro above the value in column A for the new row is 1 greater than the row previous. I'd like that to still happen even when the new row is going above the previous data. Trying to prevent duplicates is another reason why I'd like the macro to only run if cell A2 is double-clicked.
View 1 Replies
View Related
Jan 20, 2009
Perhaps an easily resolved issue, but one that stumps me. I'm building a spreadsheet that allows users to enter a date in a cell (A1). I want to restrict entries to only permit the date as MM/DD/YYYY, to include leading zeros, if necessary, so that the entry is ten digits long.
Then, I want that user entered date to transfer to another cell (B1) and transformed to the date with leading and trailing asterisks (*MM/DD/YYYY*). That entry will be displayed in bar code font. Cell B1 is to be generated by the spreadsheet, so that the user only makes the date entry in cell A1.
Formatting A1 as a date field presented many problems, to include an inability to select the ten-digit format. So I've formatted this cell as a custom cell, which works well in tranforming user entries such as 1/1/09 to the required 01/01/2009.
Problem 1: I can't get the data validation error alert feature to work properly. I set the condition to allow text length equal to 10, and every entry I try produces the error message. I've also set the condition to allow custom data using the formula MM/DD/YYYY. That also produces the error message regardless of entry.
Problem 2: I can't figure out the formula to add the asterisks to the front and back of the date for cell B1. The closest I can get is the asterisks with the date converted to a number.
View 4 Replies
View Related
Aug 26, 2008
Their is sheet in which some online data is comeing.
#1 I have to copy that data in another worksheet and its name shud be last 3 characters of the sheet in which data is comeing.
Say for example data sheet is abcd_2781 so new sheet name shud be 781
#2 now i have to copy the data based on certain validation
the sheet has 14 colums
the data keep coming in....every time it comes with a unque ID.
but when it comes there is a colum which tell us three operations
0=NEW
1=change
2=DELETE
And so when ever we copy data it shud only copy 0,1,2 it shud not copy new, change or delete.
Now there is one more colum in which their is entry ID, it carried diff ID for NEW transactions. But when ever their is change or delete it will be same what ever was generated when it was new. so the validation shud be
when its 1= change it should match its Entry ID and delete the complete ROW with all previous same ID keep this only
When its 2= Delete it should match its Entry ID and Delet the complete row with all same including itself.
i am attaching the input and out put data
Input data Output data
MDUpdateAction MDEntryID MDUpdateAction MDEntryID
0=NEW 100302 0 100302
0=NEW 100303 0 100305
0=NEW 100304 0 100306
0=NEW 100305 0 100314
0=NEW 100306 0 100313
0=NEW 100314 0 100315
0=NEW 100313 0 100316
0=NEW 100315 0 100293
0=NEW 100316 1 100291
0=NEW 100291
0=NEW 100292
0=NEW 100293
2=DELETE 100303
2=DELETE 100292
2=DELETE 100304
1=CHANGE 100291
View 9 Replies
View Related
Jul 4, 2007
I'm some cells with validation but when I copy some data (whose cells do not have the validation), and paste onto the cells with validation, the validation is no longer there.
How could I ensure that the validation is still there after the Copy-Paste action? Since the spreadsheet is used by multiple users, I can't force the users to do a Paste Special.
View 4 Replies
View Related
Apr 5, 2007
I want to make a validation for a range (daterange) to control
inserting date.
The general Idea is: If ActiveCell.date > or < from YearCell don't accept....
View 3 Replies
View Related
Sep 26, 2013
Template is created where the users copy/paste the data from other file. Data validation has been performed with the following steps:
1. Macro inserts the vlookup formula into column A, which isused for validating data that is entered by user from column B to E.
2. If the data is incorrect the N/A will be displayed in column A and invalid data will behighlighted in red color in column B.
3. This validation goes through the loop and after the loop is finished the pop message will be displayed and macro should stop so the user can correct the data.
4. After the user correct the data, the macro needs to run again to make sure there is no further errors. If there are no errors, thehighlighted cells should be cleared out of color and pop.
Here is the code that runs by command button:
Private Sub CommandButton1_Click()
Call FindNA
End Sub
Sub FindNA()
Dim ResultRange As Range
Dim ResultCell As Range
Dim iRow As Integer
[Code] ......
View 1 Replies
View Related
May 1, 2014
I want to prevent copying and pasting over cells with data validation as this means the validation is overwritten. To get around this I've selected all the cells with data validation and unlocked them, then protected the worksheet with all boxes ticked apart from format cells, columns and rows.
This prevents copy/pasting from overwriting data validation but it doesn't prevent data being pasted in that doesn't meet the validation criteria.
So for example, say -1 is in cell A1, with no data validation. In B1 there is data validation, which doesn't allow negative numbers to be entered. If I copy and paste A1 into B1, the data validation isn't overwritten, but it doesn't stop the non validated data (-1) from being entered! If I then double click on B1 and press enter it recognises the validation criteria is not met.
View 3 Replies
View Related
Nov 30, 2009
i'm trying to do (for the past couple of days manually) is copy the names from the 2nd sheet to the 1st sheet but need to make sure that the proper location ID match that of the 1st sheet. If two names is assigned to the same location, a new line will be added to the 1st sheet but never allow if the location ID do not exist.
<1st Sheet>
A1, B1, C1, D1
ID, Name, Loc ID, Location, contact, date
1011,-, 101, 1/F, RM101,-
1012,-, 102, 1/F, RM102,-
1013,-, 104, 1/F, RM104,-
1014,-, 203, 2/F, RM204,-
<2nd Sheet>
Name, Loc ID, date
Thomas,101,10/03/09
Anthony,101,11/02/09
George, 102,11/25,09
Susan,203,10/31/09
Carrie,103,11/20/09
View 4 Replies
View Related
Dec 17, 2008
I need to get data copied from sheet1 to sheet2
depending on selection in a validation list.
The data is on the same row and all the same range.
So it would look something like this.
A B C
Fruit Orange Apple Pear
Veg Potato Carrot Onion
Animal Bear Cow Dog
I have the data in A in a dynamic range and validation list.
I need all the data copied from the specific rows ie
choose Animal from the validation list in Sheet2!A1 and
the entire row Bear Cow Dog get copied to Sheet2!B1, Sheet2!C1, Sheet2!D1.
The second problem I think is a lot more complex.
So the same scenario above but this time its a multi select on Sheet3.
I need to be able to select two (or more depending on Fruit and Animals to display in A1, A2 and then their valid options to appear in B, C and D
View 9 Replies
View Related
Mar 27, 2009
I set up a spread*** with drop-down menus for some of the cells. The user can only select values from that list and an error message pops up when something is typed it that is not in the list (via Data Validation
Error Alert).
So this works all fine ... except if the user copies and pastes a cell with a different drop-down menu into a cell overwriting the existing validation.
I cannot totally lock the work*** and if I lock the cells with the drop-down menus nothing can be changed. So how can I prevent this from happening? Is there a way to block all copy/paste operations that are copying the validation? I know that with the Paste Special I can have cells copied without the validation.
View 14 Replies
View Related
Feb 11, 2010
Is there any way to use a Named Range in the "Source" field in a Data Validation? I have multiple sheets in a workbook that have the same layout, and I am using alot of different Data Validations. My problem is that whenever I need to change, or add a choice to one of these, I have to go to each sheet and change the Data Validations that are effected by that change. Is there a way to use a "Named Range" or something to put all of my acceptable choices, for that Data Validation, in one spot. And make any changes I had to that field.
View 2 Replies
View Related
Jun 22, 2009
I'm trying to fill a list with some hard values. When I use the macro recorder it adds formula="choice 1;choice 2; etc", these are all separate values in the list. However if I use this within a macro I only have one option with all three values combined.
View 4 Replies
View Related
Mar 14, 2014
In Sheet2 I have list:
columnA (name)
ColumnB (region)
Audi
Euro
Ford
USA
Chevi
USA
VW
EURO
Porshe
EURO
I used manager name to define range:
Cust_Name = Sheet2!$A:$A
Reg_Name = Sheet2!$B:$B
Now, in Sheet1 I did data validation and I have:
A2 = list of name (from Sheet2, columnA)
B2 = list of region (from Sheet2, columnB)
How to do, like if I in A2 I will choose Audi or Porshe then automatically in B2 will show Euro?
View 1 Replies
View Related
Nov 6, 2009
In need data validation in a range of cells (lets keep it to A1 for the example please). The data being entered is a 9 digit number, which needs to satisfy the following:
The 7th and 8th characters should be equal to an even number and be greater than zero, but less than 35.
Example 1: If 123456789 is entered in the cell, this would return an error because 78 (although being an even number) is above 35.
Example 2: If 987654321 is entered in the cell this would be allowed as 32 is an even number and less than 35.
View 9 Replies
View Related
Jan 16, 2007
I have been trying to figure this out for days and have searched on all the postings and cannot find my answer. I am working off of two worksheets. Sheet #1 has 3 columns. Column A "Type of Bar", Column B "Type of Activation", Column C "Amount Spent". Column A has 2 drop down boxes, Pub & Nightclub. Column B has 2 drop down boxes, Sampling & Training. Sheet #2 is is a tracker that is going to add up certain criteria off of Sheet 1. For example, I need to get the sum of All Pubs and Sampling. I also need to track All Pubs and Training, Nightclub and Sampling and Nightclub and Training. I have tried the SUMIF, IF, and Conditional Sum. I keep running into a RANGE error.
View 2 Replies
View Related
Jun 12, 2014
I have a sheet which autofilters according to a validation list in cell E2 using the code.
I have then used subtotal arrays to calculate the mean, median, max, min and total count for whichever values the filter shows.
What I want to do next is have a code which will select each possible option from the validation list (triggering the autofilter) and copy and paste the values from each dependent formula into a new sheet.
Attached File: dummy 1.xlsm
View 7 Replies
View Related
Mar 12, 2009
I have a Range on one sheet formatted like this and sorted by Sup then Rep:
Rep Sup
John Sally
Mark Sally
Joseph Sally
George Betty
James Betty
etc..
I have a Validation Drop Down list where a Supervisor is chosen. There's a specific range that I would like to automatically fill in with the reps assigned to the Sup. This is driving me crazy! I already know how to obtain that list as another Validation Drop Down, but not quite sure how to make those values appear in a range instead of a Validation List.
View 2 Replies
View Related
Jan 28, 2013
I have a cell for which I need the only options for data to be entered from a list in two different tabs from which I understand cant be done but is it possible to have two drop down options for the same cell?
The attached spreadsheet should explain this slightly better...
View 9 Replies
View Related
Feb 5, 2009
I have a monthly report showing actuals and budget for current month (or quarter) and year to date. Range names have been created for (1) each month, (2) each quarter and (3) year to date). I'm using the SUMPRODUCT function to extract information by account. For example:
=SUMPRODUCT(($A9=ACT_Account)*(ACT_Jan))
This formula works except I have to replace the "ACT_Jan" each month accordingly. Can a data validation list be created with the range names so that updating this formula monthly can be simplified? For example, changing "ACT_Jan" to "ACT_Feb" with a drop down list.
View 9 Replies
View Related
Jan 20, 2010
I have three codes (P, /P, P/) that could be entered in range H5:P5. P is counted as 1; P/ and /P are both counted as ½.
I have the following formula in D5:
=COUNTIF(H5:S5,"P")+COUNTIF(H5:S5,"P/")/2+COUNTIF(H5:S5,"/P")/2
I entered the following formula for data validation:
=SUMPRODUCT(--(H5:S5="P"))+SUMPRODUCT(--(H5:S5="P/")/2)+SUMPRODUCT(--(H5:S5="/P")/2)
View 9 Replies
View Related
Nov 13, 2006
In the attached example I have a column of data on worksheet 2. Extra rows will frequently be added and removed from the column. I want to use that column of data to populate a validation drop down box for a whole column of cells on sheet 1. (Target cells coloured yellow for demonstration purposes)
I don’t want the validation drop down to be full of blank rows so I set up a dynamic named range to refer to the column on Sheet2. It all works really well...but...only for cell D6 on sheet 2. It doesn’t work on any of the other target cells on sheet 2 or on sheet 1. I have been looking at this for far too long and it has begun hurting my brain.
View 2 Replies
View Related
Dec 5, 2007
I'm creating a sheet that takes three Validation Lists into account. The first two lists are based on named regions. The third list uses the first two lists to narrow a search down so that the user can pick what they want from a smaller selection. I'm using the code from Contextures.com to allow the user to double click the validation list to pop up a Combo Box. This allows me to show more than 8 selections at a time and also gives a little freedom on font and font size.
http://www.contextures.com/xlDataVal11.html
Since the third list is not based on a named region but rather code to compare the two previous lists, when I double click the third validation list a blank combo box pops up. it possible to pop up what ever lists are in the validation boxes.
This is the code that I have in the third validation box which States "The Source Currently evaluates to an error" but works fine for some reason. =OFFSET(CategoryStart, MATCH(B4, CategoryColumn, 0) - 1, IF(A4 = "Description", 2, IF(A4 = "ExtDescription", 3, IF(A4 = "PartNumber",4))), COUNTIF(CategoryColumn,B4), 1)
I tried making a named region that was based on the code, so that the list could change as the user selected different options from the first two lists. This gave me the same problems as I had before.
View 2 Replies
View Related
Jun 19, 2008
I have a range (offset based) which may increase by rows or columns whenever necessary.
In that I have data table like this:
HUNONETWOTHREEFOURFIVESIX
100110021003100410051006100
200120022003200420052006200
300180028003800480058006800
400140024003400440054006400
500150025003500450055006500
In the above table I want to enter in another column or row, a number which is not available in the given table (i.e. no duplication is allowed). (This table may grow both column & row wise). If, duplication is there the message box should say that the value already exist. And, if possible, the existing value can be colored with any color, so that we can easily find out where it is.
1) how to name a offset table and
2) how to avoid duplicate value when entered? Is data validation is one solution?
View 9 Replies
View Related
Jan 27, 2007
Need VBA macro that will copy & paste (Special > AS VALUES) from one of two (Data A & B) sheets based on the contents of a validation cell ($D$4) in a third (Report) sheet? The destination starting cell would be $F$11. ALSO - I'd like to have the Named Ranges "DataAExtract" & "DataBExtract" used in the code (for the COPY region) so I can see an example of how to reflect my actual named ranges in my working file.
The reason for doing this is that the "c.Characters...." lines in my conditional formatting macros (attached) are not working on cells containing formula output (in my working file the Report page is all populated by VLOOKUP results), but the macros run fine on hard-coded values. In my attached workbook, I'd like to have the "NEW" macro for the copy & paste step fire first in the sequence of macros running after the FORM button-click (control located in cell $D$5 of the Report sheet), whether that's by writing a new macro and calling mine before the new one ends, OR by consolidating all of my macros plus the new one into one smooth progression.
With this low-tech approach I can get updated VALUES into the report area once the user selects a data source and a customer on the report sheet. The COPY ranges in my working spreadsheet will update based on the selections made in the report page. I tried recording a macro and then modifying the recorded code to add the "If > Then" functionality I'm looking for, but I'm pretty green when it comes to VBA code and syntax.
View 3 Replies
View Related
Dec 12, 2013
On the Control Panel sheet of the attached book, I need to load only the non blank cells from BQ3:BQ9 into a data validation drop down.
View 8 Replies
View Related
Jul 16, 2009
I have several cells with data validation's drop Box. Every data validation uses a range name as source (myColorList). Here goes the hard part: I need a new value inside the dropBox list, but The problem is that I can NOT modify the "myColorList" range.
-- Is there any way to build up the dropbox source using the range name and the new value? Something like
View 2 Replies
View Related
Nov 7, 2012
If I have two cells and a named range mexico
A1, A2.
A1 contains the string: "mexico"
A2 is the cells that has required data validation (drop down list).
I want A2's validation reference to be dynamic, in the sense that I can it reference it to A1; converting the string "mexico" to a named range mexico
I tried inputting = INDIRECT(A1) into A2
But I lack clarity in my understanding of referencing.
What is the correct procedure here.
View 2 Replies
View Related
Dec 8, 2012
Basically in cells b12:b26 (15 cells) I need to enter the type of item (which is limited to 2 items). I made a drop down list for that range which works perfectly, therefore the user can choose either item 1 or item 2 or blank. However, I need to figure out a way so that item 1 can be chosen a maximum of 10 times in the range, and item 2 can only be chosen 5 times in that same range..
I am assuming that you can't add that condition to the drop down list... So I was thinking of adding an extra column duplicating b12:b26 (c12:=b12 etc...)- and entering a data validation there.
I was going to enter the following:
if item 1 is chose : =NOT(COUNT($c$12:$c$26)>10) &
if item 2 is chosen: =NOT(COUNT($c$6:$c$6)>5).
However, for some reason it doesn't work - it doesn't block the entry if I try to enter 11 item 1s or 6 item 2s.
View 2 Replies
View Related
Feb 25, 2009
I've got a named range which defined using a custom function. Lets call this named range [range1] which is defined by:
View 14 Replies
View Related