![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Feb 2002
Posts: 133
|
I want to write a macro whereby it takes the end user into a specific cell in edit mode and will not let the end user leave the cell blank (I have already validated the cell to require a date) any ideas?
|
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Nigel
assumming you know how to select a cell with VBA place this in the Private Module of the Sheet concerned. Right click on the sheet name tab and select "View Code" Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" Then Application.MoveAfterReturn = Not IsEmpty(Target.Value) End If End Sub As you can see it assumes your cell is A1 |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Posts: 133
|
Sorry I don't know how to select a cell with VBA.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|