![]() |
![]() |
|
|||||||
| 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
|
Dave Hawley - You may recall you helped me with this:
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 Trouble I do not know how to select a cell in VBA (fairly new to this VBA game - still learning). |
|
|
|
|
|
#2 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Nigel
To select a cell in VBA you would use: Range("A1").select or Cell(1,1).Select These are for the activesheet only. If on another sheet the easiest way is: Application.Goto Sheets("Sheet1").Range("A1"), True The True after the GoTo reference will place the selected cell in the top left of your screen. |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Feb 2002
Posts: 133
|
Thanks Dave, I will have a play with it.
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|