LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default From cell/combo to combo/cell

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert combo box in a cell art Excel Discussion (Misc queries) 3 July 20th 07 04:59 PM
Filtered list for Combo Box ListFillRange - Nested Combo Boxes DoctorG Excel Programming 3 February 23rd 06 12:15 PM
Getting A Value from a Combo Box to a Cell?? RP1507 Excel Discussion (Misc queries) 1 July 13th 05 03:14 PM
Cell Bound Combo Box Adrian Soper Excel Programming 1 June 7th 04 01:59 PM
Setting the value of a cell from a combo box Nigel BEnnett Excel Programming 1 June 1st 04 07:36 PM


All times are GMT +1. The time now is 09:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"