ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   direct to certain cells using drop down list (https://www.excelbanter.com/excel-programming/284831-direct-certain-cells-using-drop-down-list.html)

courtesio99

direct to certain cells using drop down list
 

How do i direct the user to enter certain cells after a certain data
from a drop down list is chosen?

I want to make it such that unless the respective option in the drop
down list is chosen, the user cannot enter in the corresponding cells.

Thank you.


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements

Bill Manville

direct to certain cells using drop down list
 
Courtesio99 wrote:
How do i direct the user to enter certain cells after a certain data
from a drop down list is chosen?

I want to make it such that unless the respective option in the drop
down list is chosen, the user cannot enter in the corresponding cells.


I would define named ranges corresponding to the items in the dropdown
list. I would start with all cells on the worksheet locked and the
worksheet protected. On selecting an item from the dropdown I would
unlock the relevant named range and lock all others. Something like
this:

Sub ComboBox1_Change()
With ActiveSheet
.UnProtect
.Cells.Locked = True
.Range(.ComboBox1.Value).Locked = False
.Protect
End With
End Sub

Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup



All times are GMT +1. The time now is 08:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com