Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default automated cursor movement in Excel

Hello, I want to enter data from a bar code scanner into a spreadsheet. I
want to start entering data in cell B2, the next entry into C2, then D2.
Following the third entry I want to move down to the next row and enter data
in the same manner, B3, C3, D3, then B4, C4, D4, etc. I've tried using Target.
Offset. It works to change columns after a specified entry, but I can't seem
to get the correct VB syntax to change the active cell to the next row when
working across columns. Seems like it should be pretty simple, but I am all
thumbs when it comes to programming.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default automated cursor movement in Excel

Lets say you have 1000 records.

Sub barCode()
Dim RowCount As Long
RowCount = Round(1000/3) + 1
For i = 1 To RowCount
For j = 1 To 3
If IsEmpty(Cells(i, j)) Then
'enter the code for barcode
Else
MsgBox "Cells contain data, TERMINATE!"
Exit Sub
End If
Next j
Next i
End Sub

This should give you an idea of how to walk down the
rows three column at a whack.

"KelvinP" wrote:

Hello, I want to enter data from a bar code scanner into a spreadsheet. I
want to start entering data in cell B2, the next entry into C2, then D2.
Following the third entry I want to move down to the next row and enter data
in the same manner, B3, C3, D3, then B4, C4, D4, etc. I've tried using Target.
Offset. It works to change columns after a specified entry, but I can't seem
to get the correct VB syntax to change the active cell to the next row when
working across columns. Seems like it should be pretty simple, but I am all
thumbs when it comes to programming.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default automated cursor movement in Excel

To see the macro operate, substitute this line:

'enter the code for barcode

With these two lines:

Cells(i, j) = x + 1
x = x + 1

"KelvinP" wrote:

Hello, I want to enter data from a bar code scanner into a spreadsheet. I
want to start entering data in cell B2, the next entry into C2, then D2.
Following the third entry I want to move down to the next row and enter data
in the same manner, B3, C3, D3, then B4, C4, D4, etc. I've tried using Target.
Offset. It works to change columns after a specified entry, but I can't seem
to get the correct VB syntax to change the active cell to the next row when
working across columns. Seems like it should be pretty simple, but I am all
thumbs when it comes to programming.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default automated cursor movement in Excel

First setup Excel to move one cell to the right when entering data. You do
this by clicking on Tools - Options - Edit tab. Check (click) "Move
selection after enter:" and select "Right".
Then right-click the sheet tab of your sheet and select View Code. Paste
the following macro into that module. "X" out of the module to return to
your sheet. This macro will select the cell in Column B one row down when
anything is entered into any cell in Column D. HTH Otto
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 Then Exit Sub
If Not Intersect(Target, Range("D:D")) Is Nothing Then
Target.Offset(1, -2).Select
End If
End Sub
"KelvinP" <u46982@uwe wrote in message news:8bcfbd037c7cf@uwe...
Hello, I want to enter data from a bar code scanner into a spreadsheet. I
want to start entering data in cell B2, the next entry into C2, then D2.
Following the third entry I want to move down to the next row and enter
data
in the same manner, B3, C3, D3, then B4, C4, D4, etc. I've tried using
Target.
Offset. It works to change columns after a specified entry, but I can't
seem
to get the correct VB syntax to change the active cell to the next row
when
working across columns. Seems like it should be pretty simple, but I am
all
thumbs when it comes to programming.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default barcode scaning into excel file

Hi,

I saw your message regarding moving to the next row
when barcode scanning. I haven't been able to figure this out, have you? If yes, can you share the solution?? I need to transfer about 10.000 cases
and need to upload these through an excel file.

Your help will be highly appreciated!

Many thanks!

Frank Warnars
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
CURSOR MOVEMENT Aligahk06 Excel Discussion (Misc queries) 3 September 9th 09 04:55 PM
how can I limit cursor movement within specified range in excel? slk0217 Excel Discussion (Misc queries) 2 January 5th 08 06:03 AM
Cursor Movement in Excel 2000 V9.0.3821 SR-1 LadyJean Excel Discussion (Misc queries) 3 August 12th 07 12:14 AM
Cursor movement in Excel 2007 M Small Excel Discussion (Misc queries) 2 June 18th 07 06:56 PM
excel limit data entry range, control cursor movement to 2 cols Bob Excel Programming 4 September 23rd 05 05:14 PM


All times are GMT +1. The time now is 06:24 AM.

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"