(VBA) Restrict Array Entry
Jul 9, 2013
In column A I have Dates
January till....
The code below count the number of months and then should create only, this amount of new tabs (based on monthlist array)
So if I had Dates from January till October it should create only 10 new sheets.
So far is entering all of them. I know I'm missing a loop somewhere
Code:
Sub AddSheets()
Dim lmax As Long
Dim lmin As Long
Dim lmonth As Integer
Dim cc As Integer
monthlist = Array("jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec")
[Code] ..........
View 3 Replies
ADVERTISEMENT
Nov 24, 2008
I have a userform with 8 text boxes and users have to enter different numbers separated by commas like 1,5,6,15,28 and so on.
I want to put a validation that if a number is entered in any of the textboxes than the same shall not be allowed in any other textboxes. Even in the same text box, no duplicate number shall be allowed. ie if in a textbox 1,2,15 is entered , then in the same textbox also, user cannot enter 1 or 2 or 15 again.
View 9 Replies
View Related
Apr 6, 2014
I am trying to find out whether you can restrict the rest of the userform from being available, unless a certain field is entered.
I have a tax invoice userform, I want to restrict the user from entering any other data unless they have selected a customer.
There are other fields such as Customer Address, Customer Number, Disc% and Terms that populate through vlookup code once the customer is selected, so still need that to work once the customer is selected. I just don't want them to be able to enter any other data on the userform without the customer being selected.
I wasn't sure whether I needed to enter code into every other textbox or combo box that if cboCustomer = "" then pop up an error message, but that would require a lot of code to be entered. I have 30 comboboxes and 53 Textboxes that I want to restrict to not being available unless a customer is selected from combobox.
View 4 Replies
View Related
Dec 2, 2006
How can I restrict entry into a textbox to 1 decimal place?
View 9 Replies
View Related
May 14, 2014
How do you restrict a user to only be able to enter up to 2 decimal places in a cell without it automatically rounding for them?
View 6 Replies
View Related
Apr 3, 2012
I am using the below code to enter the data in Cell "D" & "E" of the worksheet.
Dim a, b As Integer
a = WorksheetFunction.CountA(Sheet2.Range("C:C"))
ActiveWorkbook.Sheets("Retailing Data Sheet").Activate
'If Range("C" & a + 1).Value "" Then
[Code] .......
But, If someone wants to enter the data manually into the Cell "D" & "E" its allowing which i dont want.
It should be enter by using the form only...
View 5 Replies
View Related
Dec 2, 2009
I have an array formula that I am trying to populate through VBA.
Here is the whole formula.
intFirstStyleRow = 63
intFirstDataRow = 3
intLastDataRow = 135
intLastStyleRow = 195
gintBOPromo1Col = 12
gintDataFirstStyleGrpCol = 32
gintDataLastStyleGrpCol = 56
gintDataFirstDptGrpCol = 58
gintDataLastDptGrpCol = 62
gstrcDataWorkSheet = "DATA"
Cells(intFirstStyleRow, gintBOPromo1Col).Select..............................
View 9 Replies
View Related
Mar 13, 2008
I am trying to do with data validation, trying to stay away from vba on this... and it is probably very simple:
Cell A1, they can select Rice, Cheese, or Rabbit
I want to use custom data validation on B1, so that if A1 = Rabbit, they can only enter 1. If it is blank or the other two choices, they can enter 1 through 10.
Can I do that with data validation? I can't get any if thens to work in it.
View 3 Replies
View Related
Jun 19, 2008
I'm having a problem with data validation. I set an entire column so that it could only be a date between the first date in the list and the current date. I tested a few cells to make sure that it was working the way I wanted and I noticed that it allows a random number like 3 or 5 to be input after row 50. This would create a date in the 1900s. Why is this happening and how can I stop it.
View 9 Replies
View Related
Sep 18, 2007
I am looking for a forumla, which I think will be an If forumla, to allow/block entry into a cell depending on what is entered in another cell.
So if "Yes" is entered into cell 1, I want cell 2 to show "N/A", and if "No" is entered in cell 1 I want the user to be able to enter data into cell 2.
View 3 Replies
View Related
May 13, 2014
I have a macro creating an array, populating it, and using the array to fill in values. The whole array works except for one entry. The one field, if changed to have a space, works perfectly.
EG:
Not working with macro:
Redlife
Working with macro:
Red life
Other entries that are similar (eg: redwork) work fine without having to create the space.
The second worksheet is pulling information off of a website, and the entry is downloaded as redlife. I could write in a section to replace "redlife" with "red life", but it's a bit more complicated than what I know how to deal with. The array is completing the values on the first worksheet, where the array is originally populated.
View 2 Replies
View Related
Feb 11, 2012
I wonder if there is a way to enter my formulas as an array formula using Control-Shift-Enter in a more time saving way than one line by one line
I have 600 rows of array formulas all in column E but at different intervals with some blank rows inbetween
The formulas are in place but just need the CSE to enable the array formula { }
I am not looking forward to line by line entry.
View 1 Replies
View Related
Apr 11, 2012
I've been given a spreadsheet that is poorly constructed but I'm not allowed to alter.
The layout is:
Box Name Box Date ID1 ID2 ID3 ....
Where there is not a fixed number of IDs in each box
(There are five different sheets so I'll have some fun concatenating results)
Given a list of IDs I need to return the box name and box date that the ID's file sits in. The spreadsheet has blanks everywhere and the numbers contained in rows are non-consecutive and smaller values can appear later in a column than larger ones.
I think I need some combination of index, offset and maybe sumproduct? TBH, I avoid sumproducts like the plague, preferring to utilise sumifs and dynamic named ranges since this improves clarity so I'm basically a newb at them.
Any skeleton framework that you think would work to return the text values for the LHS where the number could be anywhere? Once I can see a rough example I should be able to get to grips with the logic and wrangle it into the necessary solution.
View 5 Replies
View Related
Mar 20, 2014
I have a percentage in R3.
If I make an entry in D13 then I want the R3 to be duplicated into C27 otherwise C27 should be 0.
View 4 Replies
View Related
Sep 11, 2013
I am having a sheet where I keep track of when online surveys have been sent to users. The users enail address (column K) may be on the list for several times, but I need to make sure that there is at least a 7 days pause between sending the first mail and the second, depending on the visit date (column G).If there are less than 7 days between two entries with the same email address, the user is not qualified for taking another survey.
I was thinking to write an IF formula which returns either 1 or 0 and then let conditional formatting highlight and HIDE the row via a VBA loop.
View 3 Replies
View Related
Mar 14, 2014
Is there a formula that will allow me to look for the existence of any number value in a row of one worksheet and then return a specific number value in a cell on another worksheet? For example, if the formula finds any number value it will always return the number 15 to a cell on another worksheet.
View 3 Replies
View Related
May 1, 2009
I used a form with textboxes for data input for one of my vb macros. Currently I have the private sub from the form transfer those entries to a remote cell on the spreadsheet, (like in column "HZ"), so that the macro that will actually utilize them can retrieve them. Is there a way to pass that data directly from what is entered in the form in the textboxes to the macro that will actually use them?
View 4 Replies
View Related
May 26, 2009
I am looking to create a macro that will create a new sheet when data is added on a summary sheet. Example.
1. Summary sheet called "Variations" contains columns that will contain the information needed for new sheet (Columns A to D)
2. When data is entered on "Variations" sheet: Column B, then macro automatically creates new sheet renamed to e.g. VO1 (Number used on "Variations" tab) and is a copy of "Master" tab.
3. Data entered in Column A to D on "Variations" tab is automatically entered onto new sheet created (e.g VO1). Shown is blue on attached file. Additional data is updated on "VO1" sheet and this then links back to "Variations" tab
View 6 Replies
View Related
May 28, 2008
say sheet 1 has 2 collums A & B
collum A is Names Collum B is Dates
A B
Bob Fenton 05/04/08
Rob Smith 05/06/08
Al Feth 05/08/08
Al Feth 05/18/08
Al Thomas 04/23/08
Rob Smith 05/23/08
Bob Smith 04/22/08
Bob Fenton 05/15/08
Al Feth 05/10/08
sheet 2 has unlimited collums in collum A is the name of the person in collum B to Z (or more) i would like a fomula that will search sheet 1 and return the dates for each entry of that name.
so sheet 2 would be like ....
View 9 Replies
View Related
Jun 19, 2012
I'm trying to write a macro that will not allow a number to be zero. I have a macro that references a cell that if it is input to zero will create a loop that goes on forever. The thing is this cell will never have to be zero, so is there a way that I can write a macro that if this cell is zero, it gets reset to its previous value?
View 4 Replies
View Related
Nov 16, 2006
I am looking for a VBA event(?) code that would erase another cell if I enter a value in another cell, because the criteria is that only one of the cells are to be allowed a value per row.
ex: cells A1, B1, C1
if I enter 1 in cell A1 and then enter 1 in cell C1, I want cell A1 to erase and cell C1 would have the value 1. I am looking to create these sets for 200 rows.
View 3 Replies
View Related
Mar 28, 2012
In cells B7:B229, I only want the user to be able to enter 1,2,3, or 4. How can I force this on them?
View 1 Replies
View Related
Nov 8, 2013
I have a ctrl-q key activated macro (module 2) that successfully clears specific data entry cells in forms on two identically formatted sheets. How do I prevent access to that macro on the remaining three sheets of five in the workbook?
View 2 Replies
View Related
Oct 31, 2007
How can I restrict the user from entering anything other than the date and the proper format required for this input box? I am having a tough time figuring out how to check the input for the right date and format . .
Sub EffDate()
Dim a As Variant
a = InputBox("Enter the effective date" & _
" of the subject's lease using a 2 digit day," & _
" a 2 digit month and a 4 digit year" & _
" (dd/mm/yyyy).", "C/NC Analysis")
Range("U4").Value = a
End Sub
View 9 Replies
View Related
Dec 11, 2007
I have the following code behind a save button,
I need to modify it as it currently allows the user to save even if there is no values in D2 or D3. I need it to look at these cells first as well as A17-F25 and if there is no data in any of these cells it either brings up an error message saying you need to enter data in these cells to save!
Also, at present the user has to click on the default save button within excel to save changes made after the initial save, could this be added to the button I have created?
Here is my ...
View 9 Replies
View Related
May 20, 2008
I have an excel sheet which acts as a form for multiple users, and I wanted to restrict the way certain cells can be filled in.
For example, if the value in Range E12:E100=PD then the values in Range B12:B100 must be blank. Is there anyway to do something like this?
View 9 Replies
View Related
Oct 14, 2008
I've a workbook (XL 2003) test-1.xls, and I need to restrict it to a specific computer with ID: my-a1234567k
(shown under ControlPanel::System::Computer Name::Full computer name).
Is it possible to code such restriction in the w/b Open() event to prevent opening the w/b on a different computer?
My computers each has a different OS (Win 2000, Win XP Home, Win XP Prof ), different Excel version (XL 2000, 2003, 2007), etc., and the majority of my workbooks have been developed and would work only in certain environment (e.g.; in XL 2003 only, or XL 2007 only, ... ).
View 9 Replies
View Related
Nov 28, 2009
for instance if i type in a particular cell any number 1, 0, 53 .. excel must not allow me to do this...
but there are certain value that have both number and alphatbets eg. 001 michael jordan ... cell should allow such values.
View 9 Replies
View Related
Aug 30, 2006
I am looking for a macro that would accept only one entry per selected ranges. It would be something like if there is one entry in range("b4:e4"), a message box would appear advising the user that only one entry is permitted in that range. It would give the option to delete the entry and to rekey the entry for that canditate.
I hope I am clear, if not let me know
1 entry in range("b4:e4"), per canditate
1 entry in range("f4:h4"), per canditate
1 entry in range("i4:l4") per canditate
1 entry in range ("m4:o4") per canditate
1 entry in range ("p4:r4") per canditate
1 entry in range ("s4:v4") per canditate
View 9 Replies
View Related
Nov 24, 2006
I have a survey with 2 checkboxes for each question. Users need to tick only 1 checkbox for each question. The checkboxes have been created from Forms toolbar. However the feature of checkbox is such that the user can tick more than 1 checkbox.
Is there a way that for each question only 1 checkbox is ticked? I attached a sample for your reference.
View 6 Replies
View Related