Hello and have a good time
I want to record a text value in column b with this button
I have locked all cells of the sheet
And it is locked in another column after registering the sheet number by this code
I want to first if accidentally on one of the cells of column a
It was clicked and then on button 37, it will give a message that only numbers can be entered and dont allowed and value in the cell dont be clean
Secondly, after the sheet is locked, if a cell on the page is accidentally clicked and button 37 is pressed, it should not give error 1004.
Can I do this?
Is there a way to make the buttons work only in the specified range and do nothing in other ranges?
Thankful
I want to record a text value in column b with this button
VBA Code:
Sub Button37_Click()
ActiveCell.Value = Range("h1").Value
End Sub
I have locked all cells of the sheet
And it is locked in another column after registering the sheet number by this code
VBA Code:
Sub commandbutton_click5()
Dim sh As Worksheet
Dim f As Range
Set sh = ThisWorkbook.Sheets("sheet1")
Set f = sh.Range("A:A").Find(sh.Range("f7"), , xlValues, xlWhole, , , False)
If f Is Nothing Then
sh.Unprotect
With sh.Range("A" & sh.Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Row)
.Value = sh.Range("f7").Value
.Offset(0, 1).Select
.Locked = True
End With
sh.Protect
Else
MsgBox "this number is available"
f.Select
End If
End Sub
I want to first if accidentally on one of the cells of column a
It was clicked and then on button 37, it will give a message that only numbers can be entered and dont allowed and value in the cell dont be clean
Secondly, after the sheet is locked, if a cell on the page is accidentally clicked and button 37 is pressed, it should not give error 1004.
Can I do this?
Is there a way to make the buttons work only in the specified range and do nothing in other ranges?
Thankful
Attachments
Last edited: