#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default 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
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
How to lock the Ctrl key? (as locking the Shift key w/Caps Lock) Rick-cel Excel Discussion (Misc queries) 2 August 5th 09 06:45 PM
how do I undo the scroll lock, thscroll lock button does not work scroll lock Excel Discussion (Misc queries) 3 July 19th 08 10:17 PM
I have lock a wookbook but one cell does not want to lock it Mimi Excel Discussion (Misc queries) 2 January 21st 07 10:59 PM
I have lock a wookbook but one cell does not want to lock it Mimi Excel Discussion (Misc queries) 1 January 21st 07 09:44 AM
Lock data in a cell a specific cell based on selection on other ce CrimsonPlague29 Excel Worksheet Functions 0 May 10th 06 11:06 AM


All times are GMT +1. The time now is 01:45 PM.

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

About Us

"It's about Microsoft Excel"