Greetings Excel gurus. I have run into an issue that I cant seem to resolve and I know the answer is probably simple. I am using Excel 2010
I have a spreadsheet that was built to allow users to enter data, there are two columns in the table that need to either be locked or unlocked based on what Billing code is being worked on for that sheet.
For example, use billing codes "BC1, BC2, BC3, BC4, BC5, and BC6". If a user selects BC1, from the drop down in cell "A2", as the code for that worksheet (they may enter anywhere from 2 or 3 to 300 entries), then the "Count/Unit" data column (column I) should be LOCKED and set the value to a default of 1 (as long as there is a value in the corresponding cell in columns A and G, while at the same time all the data cells in the "value" column (column H) should be unlocked and allow the user to enter a financial amount, such as 12345, which the cell now converts to 123.45.
Any of the other billing code options (BC2-BC6) should result in the "Value" column being LOCKED and the "Count/Unit" data column being UNLOCKED.
Each sheet is for one billing code, so there will not be different codes per line, at least not yet.
The code I have been playing with, without setting the default value to 1 is as follows
Within the Worksheet portion
Within the Workbook portion
Any help would be greatly appreciated.
I have a spreadsheet that was built to allow users to enter data, there are two columns in the table that need to either be locked or unlocked based on what Billing code is being worked on for that sheet.
For example, use billing codes "BC1, BC2, BC3, BC4, BC5, and BC6". If a user selects BC1, from the drop down in cell "A2", as the code for that worksheet (they may enter anywhere from 2 or 3 to 300 entries), then the "Count/Unit" data column (column I) should be LOCKED and set the value to a default of 1 (as long as there is a value in the corresponding cell in columns A and G, while at the same time all the data cells in the "value" column (column H) should be unlocked and allow the user to enter a financial amount, such as 12345, which the cell now converts to 123.45.
Any of the other billing code options (BC2-BC6) should result in the "Value" column being LOCKED and the "Count/Unit" data column being UNLOCKED.
Each sheet is for one billing code, so there will not be different codes per line, at least not yet.
The code I have been playing with, without setting the default value to 1 is as follows
Within the Worksheet portion
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ThisWorkbook.Cell_Lock_Status
End Sub
Within the Workbook portion
Code:
Sub Cell_Lock_Status() If Sheets("Billing_Entries").Range("A2") = Sheets("Import Billing Codes").Range("B3") Then
Sheets("Billing_Entries").Range("Table3[[Count/Unit]]").Locked = True
Else
Sheets("Billing_Entries").Range("Table3[[Count/Unit]]").Locked = False
End If
End Sub
Any help would be greatly appreciated.
Last edited: