Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Wu Wu is offline
external usenet poster
 
Posts: 36
Default USE EXCEL MARCO LIKE OLD VERSION LOTUS-123 --- {?}

In the marco of Lotus 123, {?} represents that let us input data in current
cell when the marco running, and then we type the button [enter], the marco
will continue to run.


Now, I would like to write a marco in Excel. After running the marco, I can
input data in current cell, and I type [enter] button, it move to right cell
to let me input other data, after three times it moves down and move to left
three cells to let me input data repeatedly.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default USE EXCEL MARCO LIKE OLD VERSION LOTUS-123 --- {?}

Hi Wu,
Your request sound like a contact data entry and I assume your column name
like below:
Col A Col B Col C
Name Title Tel contact
1 John Manager 1234567
2
3

Please try below macro, take note of I have added a Keyboard Shortcut:
Ctrl+a to triger the onkey macro. Or you may add a button to link to "Start"
macro.

Sub Start()
' Keyboard Shortcut: Ctrl+a
Application.OnKey "~", "Data_Entry"
Cells(65536, 1).End(xlUp).Activate
ActiveCell.Offset(1, 0).Select
End Sub

Sub Data_Entry()
Cells(65536, 1).End(xlUp).Activate
If ActiveCell.Offset(0, 1) = "" Then
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell.Offset(0, 2) = "" Then
ActiveCell.Offset(0, 2).Select
Else:
ActiveCell.Offset(1, 0).Select
End If
End Sub

If this post helps click Yes

"Wu" wrote:

In the marco of Lotus 123, {?} represents that let us input data in current
cell when the marco running, and then we type the button [enter], the marco
will continue to run.


Now, I would like to write a marco in Excel. After running the marco, I can
input data in current cell, and I type [enter] button, it move to right cell
to let me input other data, after three times it moves down and move to left
three cells to let me input data repeatedly.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default USE EXCEL MARCO LIKE OLD VERSION LOTUS-123 --- {?}

What's the reason for the '~' key in the line
Application.OnKey "~", "Data_Entry"?

Shouldn't it rather be:
Application.OnKey "^{a}", "Data_Entry"?

see the online reference for the OnKey event:
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

"NelsonTan" wrote:

Hi Wu,
Your request sound like a contact data entry and I assume your column name
like below:
Col A Col B Col C
Name Title Tel contact
1 John Manager 1234567
2
3

Please try below macro, take note of I have added a Keyboard Shortcut:
Ctrl+a to triger the onkey macro. Or you may add a button to link to "Start"
macro.

Sub Start()
' Keyboard Shortcut: Ctrl+a
Application.OnKey "~", "Data_Entry"
Cells(65536, 1).End(xlUp).Activate
ActiveCell.Offset(1, 0).Select
End Sub

Sub Data_Entry()
Cells(65536, 1).End(xlUp).Activate
If ActiveCell.Offset(0, 1) = "" Then
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell.Offset(0, 2) = "" Then
ActiveCell.Offset(0, 2).Select
Else:
ActiveCell.Offset(1, 0).Select
End If
End Sub

If this post helps click Yes

"Wu" wrote:

In the marco of Lotus 123, {?} represents that let us input data in current
cell when the marco running, and then we type the button [enter], the marco
will continue to run.


Now, I would like to write a marco in Excel. After running the marco, I can
input data in current cell, and I type [enter] button, it move to right cell
to let me input other data, after three times it moves down and move to left
three cells to let me input data repeatedly.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default USE EXCEL MARCO LIKE OLD VERSION LOTUS-123 --- {?}

As per "Wu" requirement, only when the button "Enter" then macro start to
work. Therefore, the "~" is represent a [Enter] button.

"A possible solution" wrote:

What's the reason for the '~' key in the line
Application.OnKey "~", "Data_Entry"?

Shouldn't it rather be:
Application.OnKey "^{a}", "Data_Entry"?

see the online reference for the OnKey event:
http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

"NelsonTan" wrote:

Hi Wu,
Your request sound like a contact data entry and I assume your column name
like below:
Col A Col B Col C
Name Title Tel contact
1 John Manager 1234567
2
3

Please try below macro, take note of I have added a Keyboard Shortcut:
Ctrl+a to triger the onkey macro. Or you may add a button to link to "Start"
macro.

Sub Start()
' Keyboard Shortcut: Ctrl+a
Application.OnKey "~", "Data_Entry"
Cells(65536, 1).End(xlUp).Activate
ActiveCell.Offset(1, 0).Select
End Sub

Sub Data_Entry()
Cells(65536, 1).End(xlUp).Activate
If ActiveCell.Offset(0, 1) = "" Then
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell.Offset(0, 2) = "" Then
ActiveCell.Offset(0, 2).Select
Else:
ActiveCell.Offset(1, 0).Select
End If
End Sub

If this post helps click Yes

"Wu" wrote:

In the marco of Lotus 123, {?} represents that let us input data in current
cell when the marco running, and then we type the button [enter], the marco
will continue to run.


Now, I would like to write a marco in Excel. After running the marco, I can
input data in current cell, and I type [enter] button, it move to right cell
to let me input other data, after three times it moves down and move to left
three cells to let me input data repeatedly.

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
run marco to send a excel file by email(lotus note) Wu Excel Discussion (Misc queries) 1 December 12th 09 05:42 AM
What version of Excel converts Lotus 1-2-3 spreadsheets? roberta New Users to Excel 1 October 17th 06 09:44 PM
Recover earlier version of excel sheet after new version saved? stephanie38 Excel Discussion (Misc queries) 3 June 17th 05 03:52 AM
VBA get lotus notes version number Michel C Excel Programming 1 October 29th 04 02:08 PM
Marco vs Lotus Note Stel Excel Programming 3 January 14th 04 09:56 PM


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