![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Posts: 134
|
I am using a spinner to display the numbers 1-4 in a cell,I want these numbers to remain visible,the thing is when I protect the sheet this cell remains vulnerable to clear contents.Is there any way to protect these numbers from being cleared?
t Thanks Charlie |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,065
|
spinners ???? you can only show 1 cell visable,......
i think im right.. not a spinner fan try alternative active x control.. any help?
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Christchurch New Zealand
Posts: 1,030
|
no I think what he means jack is that he wants to protect the sheet and still use his spinner to change the number in the cell from 1-4 but when protected the cell cannot be changed, if he unlocks the cell it can be wiped so what he needs is some code to unlock the sheet when the spinner is pressed then relock afterwards.
|
|
|
|
|
|
#4 |
|
Board Regular
Join Date: Mar 2002
Location: Cincinnati, Ohio, USA
Posts: 6,824
|
Go ahead and lock the cell displaying your values.
Simply add this to your spinbutton_Click routine. Before the assignment: Sheet1.Unprotect Chg cell value... After the assignement: Sheet1.Protect If you are using a password, then add this to both statements... Password:="YourPassword" Ex. Sheet1.Unprotect Password:="YourPassword" Of course, replace Sheet1 with the correct sheet name or use this syntax: Sheets("YourSheetName").Unprotect Password:="YourPassword" Id you are only working on the Activesheet, you may use: ActiveSheet.Unprotect Password:="YourPassword" Tom |
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Posts: 134
|
Thanx for the replies lads but I found a simpler solution,I hid the row with the output data in it thus protecting it from alteration , and I simply put in an appropriate cell =D20 which is the cell reference.This cell was covered by the normal protect sheet mechanism.
Thanks Charlie |
|
|
|
|
|
#6 |
|
Board Regular
Join Date: Feb 2002
Posts: 3,065
|
sorry been lurking elsewere..
the reason is VBA is not always the answer as Chris D will tell, im for telling him to hide data , this has been covered, TsTom like that code.... very good hope you dont mind if i keep that one.
__________________
Free Excel based Web Toolbar available here. Jack in the UK J & R Excel Solutions "making Excel work for you" |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|