excel options
i have three option button 29, 34, 32
when i click 29 or column 34 column o(14:333) not enable to enter
option 32 only column o (14:333) shoudl enable to enter
coudl you provide the code in vba
thanks
Printable View
excel options
i have three option button 29, 34, 32
when i click 29 or column 34 column o(14:333) not enable to enter
option 32 only column o (14:333) shoudl enable to enter
coudl you provide the code in vba
thanks
Private Sub OptionButton32_Click()
If OptionButton1.Value = True Then cELLS.cOLUMNS [o2:O333] = "YES" ' how do mention the range here
End Sub
Private Sub OptionButton2_Click()
If OptionButton2.Value = True Then cELLS.cOLUMNS [o2:O333] = "NO"
End Sub
Is this what you want?
Code:Private Sub OptionButton32_Click()
If OptionButton1.Value = True Then Sheets("Sheet1").Range("O2:O333").Value = "YES"
End Sub
Kool
is that i can enter in the cell is it not
i am trying to do when i click the optionbutton it should allow to enter range 02: 0333
but still failed
If OptionButton1.Value = True Then Sheets("Sheet1").Range("O2:O333").enabled = "YES"
could anybody help this
I am trying ot do when i click the option button it does not allow me to enter anything
Private Sub OptionButton60_Click()
Dim RngPST As Range
Set RngPST = Sheets("Sheet1").Range("A14:A600")
Sheets("Sheet1").Range("A14:A600").Value = ""
End Sub
1. Do you get any error messages?Quote:
it does not allow me to enter anything
2. Is the worksheet protected?
kool
when i enter in the cell. the cell should not allow to enter anythign when i press option button
try recording a macro of protecting the range
i guess you would have set protection off for all cells, then protection on for the specific range, then protect the worksheet, with or without password
you can try like this
vb Code:
Dim s As Worksheet Set s = Sheets("sheet1") s.UsedRange.Locked = False Range("o14:o333").Locked = True s.Protect "mypass"
to allow access to those cells again just unprotect the sheet
Well in that case follow what Pete said.
However remember that after you record the macro and if you password protect the worksheet using a password then the macro doesn't show the password so you will have to amend it accordingly for example
similarly to unprotect use thisCode:Activesheet.Protect "MyPassword"
Edit: Pete!!!!! Speedy Pete!!!! you beat me again... :lol:Code:Activesheet.UnProtect "MyPassword"
kool pete
is the option button click or do i have to enter in worksheet change event.
when us ther user enters in the cell and press enter or tab or page dpwn it should say the cell shoudl should be blank or when the option button click it should hide the cell and unhide . the cplumns contains validate rule for other option button
you can set the cells to locked (or hide) from the option button
when locked excel gives some message when user tries to edit
Westconn and kool thanks it works