Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
lock cell
Hello,
f worksheet 1 in " A1 " cell enter any value than cursor move other cell otherwise massage box shown " enter any value " give me vba macro for this problem how it possible |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
lock cell
kalpesh wrote:
f worksheet 1 in " A1 " cell enter any value than cursor move other cell otherwise massage box shown " enter any value " Can you clarify this? It looks like you're asking for verification that A1 hasn't been left blank, is that right? If so, put this in the sheet's object in the VBA editor: Private currentCell As Range Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Not (currentCell Is Nothing) Then If currentCell.Address = "$A$1" Then If Len(currentCell.Value) < 1 Then MsgBox "A1 cannot be blank." Set currentCell = Nothing Cells(1, 1).Select Else Set currentCell = Target End If Else Set currentCell = Target End If Else Set currentCell = Target End If End Sub I leave it to you to figure out how to get currentCell set to the proper value the first time the sheet is displayed. give me vba macro for this problem how it possible Let's see if he replies this time. -- Come explore the future with me! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to lock the Ctrl key? (as locking the Shift key w/Caps Lock) | Excel Discussion (Misc queries) | |||
how do I undo the scroll lock, thscroll lock button does not work | Excel Discussion (Misc queries) | |||
I have lock a wookbook but one cell does not want to lock it | Excel Discussion (Misc queries) | |||
I have lock a wookbook but one cell does not want to lock it | Excel Discussion (Misc queries) | |||
Lock data in a cell a specific cell based on selection on other ce | Excel Worksheet Functions |