Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
CURSOR MOVEMENT | Excel Discussion (Misc queries) | |||
how can I limit cursor movement within specified range in excel? | Excel Discussion (Misc queries) | |||
Cursor Movement in Excel 2000 V9.0.3821 SR-1 | Excel Discussion (Misc queries) | |||
Cursor movement in Excel 2007 | Excel Discussion (Misc queries) | |||
excel limit data entry range, control cursor movement to 2 cols | Excel Programming |