i have managed to pull together some code that will deny people adding data into cells if they have 5 of the same entry. the entries are entered in a range and are matched against a single cell outside of the range. heres the
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim greycell As Range, i As Long
If Not Intersect(Target, Me.[grey]) Is Nothing Then
Application.EnableEvents = False
For Each greycell In Target
If WorksheetFunction. CountIf(Me.[grey], greycell.Value) > 5 Then
i = greycell.Interior.ColorIndex
greycell.Interior.ColorIndex = 3 'red
greycell.Select
MsgBox "no cell entry past 5", vbCritical, "ERROR"
greycell.ClearContents: greycell.Interior.ColorIndex = i
End If
Next
Application.EnableEvents = True
End If
End Sub
what i need with is adapting this code to match two ranges as i cant use the worksheet_change event twice. i need it to be as if they were seperate events but are merged together. eg:.............
i'm trying to get a column to count all blanks but only if there's and entry in the cell to the left. for example i have a list of names which is picked up from my main database in column a, then in column b there's dates, non applicables and blanks. however the columns are longer than the list of names to allow for growth, so there's a lot of blanks at the bottom which i don't want to count. so is there a way to count only the blanks in column b if there's a name in column a alongside it
I have 4 columns wherein the details are somewhat given below. Is there any way, wherein the figures under the column "No. of times" can be circled if it goes above 3.
Sheet1 CDEF19DateTimeMin.No. of times20Apr-0821Wed - 09-Apr-20082:42 & 2:494 & 23222Thu - 10-Apr-200803:215123Fri - 11-Apr-200810:27, 7:24 p.m., 7:39 & 7:401, 8, 1 & 12424Tue - 15-Apr-200810:26, 10:31, 10:32, 11:26 & 11:306, 2, 4, 4, 25 Excel tables to the web >> Excel Jeanie HTML 4
The user enters data into Column E on Sheet1 and i want my code to display a pop-up box when a cell's value exceeds 500. I've tried the two codes below which i thought would work as Excel didn't highlight any breaks when i wrote the code, but no pop-up box is being generated when values > 500.
ATTEMPT 1:
Private Sub Threshold_Check2(ByVal Target As range) Dim cell As range
For Each cell In ActiveSheet.UsedRange.Columns(5).Cells If cell.Value > 500 Then MsgBox "Value within 15% of Threshold" Next cell End Sub
ATTEMPT 2:
Sub Threshold_Check(ByVal Target As range) Set Target = range("E1:E150") For Each cell In range("E1:E150") If Target.Value > 500# Then MsgBox "Value within 15% of Threshold" End If End Sub
but i need to have it split in to individual cells so
Cell A1 would be 101 hampton court B2 Hampton Heath C2 Hampton Town D3 Hamptonshire E5 HA01 1AS
each part of the address is split by a comma, so i have tried to use that as a identifier as to where that part of the address is, but failed on that, i can separate out the first part and the post code with a find and replace but not the middle.
also i need it to work backwards ie
it finds the post code first,
then the county
then the town
as those 3 are always the last 3 parts, but the address could only have 1 line of addres beofre the town or 3, and it would get messed up as all the post codes, county ans town needs to be in their respective columns
I have a cell with a formula in it. I want to use conditional formatting on this cell if the formula result leaves it blank. Given the formula is in the cell it's never recognised as blank. If an entry is input instead the formula then obviously I don't want the conditional formatting.
What formula can I use in the conditional formatting for it to recognise the Cell formula as blank?
I have a worksheet/ book that needs to be shared with staff BUT they must not be able to print the worksheet/book. Allowing them to 'view only' does not prevent them printing the doc.
I have a sheet that I fill out with customer data then print and start over with the next customer. This requires me to tab and delete through the sheet before starting the next entry and I am wondering if there is some way to auto clear the unlocked cells based on a single entry IE when we entered new data in the 1st field this would clear the unlocked cells and make them ready for new data?
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.
Daily Iam Entrying 100`s Of Supplier Data And Material Detail,
I Want Data Should Be Poped Out While Entering In Dataentry Sheet And Data Selction Should Be From Ohther Prefilled Cells. Auto Merged Post Until 24 Hrs Passes;Here Is The File
I've never dealt with vba before and I'm not even sure if that's correct. I wish to lock a worksheet with two cells left unlocked, when an entry is made in one or other of these two cells I need other cells to become unlocked.
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.
i have a data validation problem is there a way i can use =INDIRECT(DEC!'Ai11>DEC!'AJ11) is this correct? when the cell in dec AI11 is greater than AJ11 i need a validation stop to take place
When users enter data, I want them to enter a percentage into column D OR a dollar amount into column E, or enter nothing at all, but NEVER to enter into both D and E on the same row. They are set to zero by default.
It would be great if a message box could just pop up saying they can do one or the other, and if they've already entered into the other cell they need to zero it out before changing this cell.
I have two colums. In A1:A4 are ticket numbers of products made. In B1:B4 are the number of stillages that the tickets relate to. What i am trying to work out, is a formula that will calculate the number of stillages produced based on the fact that each ticket number begins with "150". I have tried using COUNTIF, MATCH and FIND functions, but when i does work, will only return a value of 1.
I am using a spreadsheet written by someone else that contains a type of cell entry I am not familiar with. These occur in several tables. The first 3 columns of each table contain numbers or basic formulas. These are followed by two columns in which every entry appears to be the following:
{=TABLE(,B33)}
Despite the same apparent "formula", the number displayed in each of these cells is different. If I click on the formula display box (to the right of the cell address box) to edit the "formula", the brackets disappear.
Can anyone tell me what sort of beast I am dealing with here?
I want to require cell entry by users. For example, if a user wants to entry information in cell C1, they must first enter information in cell A1 and cell A2. If there is no information in both of those cells, I want to display an error message to the user indicating they need to first enter information in those two cells.
I have a cell in which I want either a Y or a N entering. I do not want this cell to be left blank.
I can add a validation so that nothing but Y or N can be entered but it doesn't stop it being left blank. I entered an N (as a default) forcing the user to change it to a Y if needed but I don't want them to be able to delete and leave the cell blank.
Is it possible to count the entries into a cell? Example cell A1 (=5+5+5) this would total 15 but could it count that there were 3 entries? Is it possible to do it both postive and negative. Cell A1 (5+5-1) this would total 9 but it would count 2 if you want negative entries subtracted. or it could count 3 if you wanted all entries. I think this would be two different formulas.
I have an Excel sheet which serves as an input form. I would like to set something up where if the user inputs any value into the cell range B12:B100 then they are forced to also enter a value in column J of that same row.
Maybe something could be done where if they enter a value in B12, then they cannot enter a value in B13 before entering a value in cell J12?
What could be the formula if i want a particular cell to auto sum the data input. For example if i click cell a1 and entered a number and again entered a number , the previous entry will be added to recent entry.
What do I need to add to this script in order to stop the macro after the last cell with data. Currently it will continue to add and additional sheet and then error out b/c the next cell is blank and it doesn't know what to enter as the worksheet's name.
For Each c In Sheets("Sheet1").Range("A1:A24") Sheets.Add ActiveSheet.Name = Right(c.Value, 30) Next c
I am using the code below to prompt the user to enter his/her name in cell B4. What I would like to do is have it so that after the user enters his/her name, that cell is locked and cannot be cleared.
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$B$4" Then Range("B4").Value = InputBox("Please Enter " + Range("a4"), "Company") End If End Sub