Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Advancing from Cell to Cell on Key Press
Hi all, I am in the process of migrating from Lotus 123 to Excel. My macro
for advancing through the various fields in my spreadsheet will neither run nor translate. Sooooo! I need help. I can select a field for input [ example - Range ("F5").Select] at this point I want the program to suppend execution while I input information then resume and proceed to the next field when I press the return key (or another appropriate key). Any Help would be greatly appreciated. Thanks, -- Lee C |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Advancing from Cell to Cell on Key Press
Lotus and Excel function quite differently in terms of macros. Paste this
code into a sheet (right click the tab - View Code - Paste) and change the values of A1, B2, or C3 and trace the code through to see what is happening (F9 to place a break point -F8 to advance one line of code at a time). Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo ErrorHandler Application.EnableEvents = False 'Place a break point here Select Case Target.Address Case "$A$1" ActiveSheet.Range("B2").Select Call Message1(Target) Case "$B$2" ActiveSheet.Range("C3").Select Call Message2(Target) Case "$C$3" ActiveSheet.Range("A1").Select Call Change(Target) End Select ErrorHandler: Application.EnableEvents = True End Sub Private Sub Message1(ByVal Target As Range) MsgBox Target.Value & " Changed This" End Sub Private Sub Message2(ByVal Target As Range) MsgBox Target.Value & vbTab & Environ("UserName") End Sub Private Sub Change(ByVal Target As Range) Target.Value = Target.Value & " Changed The Other" End Sub -- HTH... Jim Thomlinson "Lee C" wrote: Hi all, I am in the process of migrating from Lotus 123 to Excel. My macro for advancing through the various fields in my spreadsheet will neither run nor translate. Sooooo! I need help. I can select a field for input [ example - Range ("F5").Select] at this point I want the program to suppend execution while I input information then resume and proceed to the next field when I press the return key (or another appropriate key). Any Help would be greatly appreciated. Thanks, -- Lee C |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel automaticly advancing copied cell numbers | Excel Worksheet Functions | |||
Excel automaticly advancing copied cell numbers | Excel Worksheet Functions | |||
How can I delete 1 from the value of a cell when I press a Button. | Excel Programming | |||
Copy Cell or Column without advancing formula reference? | Excel Discussion (Misc queries) | |||
automatic cell advancing | Excel Programming |