Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default 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
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
Excel automaticly advancing copied cell numbers Amazon H. Excel Worksheet Functions 5 August 18th 07 05:01 AM
Excel automaticly advancing copied cell numbers Max Excel Worksheet Functions 1 August 17th 07 01:54 AM
How can I delete 1 from the value of a cell when I press a Button. Gary Excel Programming 2 April 4th 05 09:03 PM
Copy Cell or Column without advancing formula reference? sgluntz Excel Discussion (Misc queries) 1 March 17th 05 07:13 PM
automatic cell advancing Marc Excel Programming 1 October 28th 04 03:21 PM


All times are GMT +1. The time now is 03:39 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"