Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I finally have the code up and running (Sheet1 is protected so that only a
few unlocked cells can be selected): ======================================== In a module: ------------------------------------------------------------------------ Global oldtarget As Range ======================================== In ThisWorkbook: ------------------------------------------------------------------------ Private Sub Workbook_Open() Range(ThisWorkbook.Names("StartCell")).Select Set oldtarget = Range(ThisWorkbook.Names("StartCell")) With ThisWorkbook.Sheets("Sheet1") .EnableSelection = xlUnlockedCells .Protect End With End Sub ======================================== In Sheet1: ------------------------------------------------------------------------ Private Sub ComboBox1_Click() Application.Range("NextCell").Select End Sub ------------------------------------------------------------------------ Private Sub ComboBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) If KeyCode = vbKeyReturn Then Application.Range("NextCell").Select End Sub ------------------------------------------------------------------------ Private Sub Worksheet_SelectionChange(ByVal Target As Range) ActiveSheet.Unprotect If oldtarget.Address = Range(ThisWorkbook.Names("StartCell")).Address Then ComboBox1.Activate Set oldtarget = Target ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True End Sub ======================================== |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Insert combo box in a cell | Excel Discussion (Misc queries) | |||
Filtered list for Combo Box ListFillRange - Nested Combo Boxes | Excel Programming | |||
Getting A Value from a Combo Box to a Cell?? | Excel Discussion (Misc queries) | |||
Cell Bound Combo Box | Excel Programming | |||
Setting the value of a cell from a combo box | Excel Programming |