I need a checkbox (actually a few but I will use the same code and change the name and cell reference) to do the following
Checkbox in A1 is ON by defaultB1 is 100User can free change the value of B1 when checkbox is onWhen checkbox is OFF"100" (or whatever number entered by the user) gets storedB1 changes to a relatively large number "9999"B1 changes cell color to grey and is locked for editWhen checkbox is ON againThe value stored previous to checkbox turned OFF is restored back to B1B1 changes back to normal cell color (no fill or white)B1 is unlocked and user can edit the cell
I currently have a spreadsheet with a userform that has multiple checkboxes. I want these checkboxes to change the value of cells depending on whether or not they are checked. 1 for not checked, 2 for checked. The column of the named range the cells are in is constant for each checkbox (though it is different for each checkbox and some checkboxes will need to change the value of a cell in multiple columns). The row changes depending on the value of a combobox on the userform. I have sorted out a code that works, but it seems very long, slow, and inefficient. I'm hopping someone can show me a better way to do it.
Private Sub CmbFinish_Click() Dim rClSkills As Range Dim rClLookup As Range Dim var1 As Integer Dim iDecision As Integer Set rClSkills = Range("TblClSkills") Set rClLookup = Range("ClassLookup") iDecision = MsgBox("Are you sure you wish to change Skills?", vbYesNo, "Continue?") If iDecision = vbYes Then var1 = Application.WorksheetFunction.Match(cboClass.Value, rClLookup, 0) If CboAppraise.Value = True Then.............................
I'm trying to make cell values in a range change so they appear blank when a checkbox is checked, and when it is unchecked, I need the original value to appear. I have the following so far:
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then Range("BTS").Value = ""
End Sub
...However I do not know how to change the cells back to the original value before it was made blank.
I have been using different keywords to find what I need. I have 3 checkboxes: cash, amex, other. I have a subtotal cell. When the appropriate checkbox is checked, the amount from the subtotal cell will auto go to the cell next to the checkbox. Is this VB?
Currently have a column of cells that after the data has been entered we would like the cell to lock to prevent changes. The sheet is currently protected with the cells in question unlocked (D173:D250). We would like to be able to change the data if we unprotect the sheet. We would also like to be able to add/delete cells (list) in the code as needed.
I'm trying to write a vba code that does the following....
There is a question in column A to which the user chooses yes or no from column B. Based on the response in column B, I'd like the same row column D to be formatted so that if the anser is yes, the cell is white, and unlocked. If the response is no, the cell is cleared, locked and the greyed out. (e.g. if B4 is "Yes", the format in D4 will change) So far I've come up with the following which formats the colour:
Dim response As Range For Each response In Range("$C$10:$C$73") If response.Value = "Yes" Then
response.Select ActiveCell.Offset(0, 2).Range("A1").Select With Selection.Interior
[Code] .......
How to add in a .clearcontents function, so that the contents are cleared if the response is not "yes", and also what I would need to add to unlock the cell in column D?
Is it possible to lock in the formatting that would require 12 digits even if someone was copying and pasting to the cell?
We are looking to make our users add information into cells in the format 0-00000-00000-0. They are often copy and pasting, thus overwritting the custom format we have in those cells.
I've looked at validation, but custom only works for a formula.
I have this worksheet with 2 buttons and 2 textboxes.the first button is named search literally to search the items inputted in the textboxes and the second button is clear which clear all the inputted items in the textboxes and the search field. I manage to code those things however I have a main problem. How am I suppose to linked a checkbox with those items?
For example I searched this particular item so the checkbox corresponding to that item must show up in the left most column of it. and if I searched multiple items those checkboxes must show up too. I am having a hard time coding and trying since I am new in vba. I also attached a sample worksheet. I am using excel 2007.
I need to lock the cells in a certain column based on the value of the right side cell. If the value of the right side cell is "Slave" it should lock the cell, otherwise it should remain unlock. I read many codes in the internet but none of them worked properly for me.
Different users can access my excelsheet to make a selection out of a drop down list, all other cells are locked and the worksheet is protected. There is an amount of "working shifts" all in row D one under another, the users can link people to that "working shift" based on the people that are in a drop down list (data validation).
So shift in D5 will be attributed to the person selected in E5; D6 to E6; ... This happens in multiple sheets in the workbook.
Problem:
Once I verified the link of the person to the "workshift", I put "OK" in cell F5 (not directly, but through a VLOOKUP that searches in a summarysheet). As soon as "OK" is in cell F5, I want cell E5 to be locked. But also for F6 and E6 ... (range: E5:E250).
This way, no one can change the person that I verifed (nor is the person changed without me noticing it).
I can have amacro which will lock each cell where a "Y" or "N" is inserted........ eg the netire sheet is unprotected but the moment Y is inserted in C 5 the cell gets locked, next entry in D 10 has a N entry and that too upon entry get's locked The idea being once Y or N is typed that cell can no longer be changed
I have a multisheet excel workbook that I am programming. I was wondering if there is a way to lock a cell on one sheet after the initial value was put in, allowing me to change it later. This may not be so clear so here is the problem....
I have Workbook1. The input from cell A3 on Sheet1 is 5. I have made a second sheet called Order Form. In cell B5 of Order form I have made it ='Sheet1'!A3. I am looking for a way to be able to change cell A3 on Sheet1, but keep the 5 on Order Form.
I have an sheet(see attached) with some dummy data, now i want to lock (with password) only those cells depending on the dropdown (highlighted in sheet).For eg,if we select A from dropdown of col c and then locked from dropdown of col D , it should lock the complete row(s) of value A in col H and rows with value B shall remain editable.
I have a range of cells I want to become locked (thus, uneditable), based upon the value of another cell.
For example, if cell A1 is "True," (based on a drop-down, not a formula) I want cells B1:B10 to become locked. I want the user to be able to edit these cells only when A1 is false. Also, the sheet is already passsword protected.
Is there a way I can lock a set of cell to only allow 30 characters or less and if so if they copy and paste they can go over 30 characters in a cell. I can not allow they to go over 30 characters.
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
Is it possible to lock the Cell after selecting the answer from list of that cell? mean disable that cell from editing, deleting, and selecting another answer
I need to have a current row password protected when the value in ActiveCell.Offset(0, 0).Value = "Close" but just to lock that current row. What I have is a close button on a userform that changes the ActiveCell.Offset(0, 0).Value = "Close", i just need to add another line of code to lock the row.
VB: ActiveCell.Offset(0, 0).Value = "Close" (And lock current row With password 123)
I want to learn how i can able to do a function or ... to LOCK a Cell automatically after editing or typing and no one able to edit it again without entering Password.
0: i have a sheet 1 protected and few edit range (Col A,B,C,D,E and F).
1: I have a validation on multiple adjacent columns (like Col A, Col C, Col E). 2: I need a code where if i select value in col a (cell A2) cell B2 should get current date and Time and both the cells (A2 and B2) should be locked. when i select data in cell C2 , D2 should get current date and time(Cell C2 and D2 should be protected). 3: User can enter data in A3 and B3 will get current date and Time (now A3 and B3) should be locked. 4: I need a function where user can call it and unlock the locked cells and edit the data and re-lock the cells again.
apart from the Col A,B,C,D,E and F, other columns and cells remain locked.
I wish to be able to lock an entire row after an entry has been made in a certain cell.
e.g. let's say i want to lock row 9 in its' entirety following entry of "Yes" in cell G9. If there is no entry in G9 the the entire row should be still unlocked. Likewise with any row with a corresponding entry in column G.
In the attached example, I need to create a formula for cell I2 (Balance Remaining) that is driven off the most recent calculation (in this case, F68) but still allows for additional rows to be added to the ongoing list of orders. I believe I'm supposed to use an index formula but not sure how to write/apply it? I need to be able to add rows past 68 and still have Cell I2 (Balance Remaining) continue to calculate correctly.