![]() |
![]() |
|
|||||||
| 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 |
|
New Member
Join Date: Feb 2002
Posts: 2
|
I have created a form used to confirm orders. I would like to make a macro to move from cell to cell after data has been entered. For example, the macro would go to cell A1 where data such as name would be entered, them move to cell A5 where address would be entered then to cell a6 where city would be entered and so on.
Thanks. |
|
|
|
|
|
#2 |
|
New Member
Join Date: Feb 2002
Posts: 4
|
This is a copy of a portion of a macro that I use to enter data into consecutive columns. Note: Active cell.offset (row, column) tells the cursor where you want to go. For example . Active cell.offset (1,1) tells the macro to go down one row and over one column.
sub enterdata () inputdata: ActiveCell = InputBox("Date?", vbOKCancel) ActiveCell.Offset(0, 1).Select ActiveCell = InputBox("Invoice Number?", vbOKCancel) ActiveCell.Offset(0, 1).Select ActiveCell = InputBox("Amount Paid?", vbOKCancel) ActiveCell.Offset(1, -1).Select Selection.End(xlToLeft).Select ans = MsgBox("Do you Want to Key Another?", vbYesNo) If ans = vbYes Then GoTo inputdata Else: Exit Sub End If Good Luck! |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Denver, Colorado USA
Posts: 4,014
|
Hi Steve,
One of the easiest ways to do this is to simply unlock all the cells that data may be entered into. You can do this by selecting them (Ctrl-click on each cell in succession), then go to Format -> Cells -> Protection tab, uncheck the Locked checkbox. Then protect the whole worksheet (Tools -> Protection -> Protect Sheet). Just make sure to write down the password if you assign one. Once you have done this, control will always skip to the next unlocked cell when you tab or enter data.
__________________
Keep Excelling. Damon VBAexpert Excel Consulting (My other life: http://damonostrander.com ) |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|