Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Auto go to beginning of next row after "n"th cell is populated??

I am scanning 4 barcodes to 4 cells then I need to drop to the
beginning of the next row to scan 4 more, ect. ect., is there a
formula for doing this or is it like a macro or something?
Thank you,
Dan
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,203
Default Auto go to beginning of next row after "n"th cell is populated??

Well, this is totally independent of whatever is going on to get your scanned
barcodes into the proper cells. What it will do is move down 1 row and back
to the left 3 columns when an entry is made into a column you specify (the
4th column). I've used D for that column which will make it move down and
back to column A, but if you are entering bar codes into B:E, just change the
"D" to "E" and it'll work.

The code is triggered by a change in the cell on a worksheet, and so the
code must go into the worksheet's event module. To get the code where it
needs to be, open the workbook. Choose the sheet where you're entering the
barcodes. RIGHT-click on the sheet's name/tab and choose [View Code] from
the list that appears. Copy the code below and paste it into the code module
presented to you. Close the VB Editor and try it out.

Private Sub Worksheet_Change(ByVal Target As Range)
'looks for a change in the specified column, and
'if it took place there, it drops to the next row
'and over 4 columns to the left. So the specified
'column cannot be A, B or C.
Const triggerColumn = "D"
'we only want to do this if:
' only a single cell has changed
' it is in our trigger column
'Assumption: that when the value in the
'trigger column changes, there are already
'entries in the previous 3 cells on the row.
If Target.Column < Range(triggerColumn & 1).Column _
Or Target.Cells.Count 1 Then
Exit Sub
End If
'ok, in right column and only 1 cell affected
'go down 1 row, to the left 3 columns
Target.Offset(1, -3).Activate

End Sub


"Dan" wrote:

I am scanning 4 barcodes to 4 cells then I need to drop to the
beginning of the next row to scan 4 more, ect. ect., is there a
formula for doing this or is it like a macro or something?
Thank you,
Dan

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
How do I auto transform sets of data? (change "female" to "f") Liz Excel Discussion (Misc queries) 2 April 2nd 23 08:53 PM
text string: "91E10" in csv file auto converts to: "9.10E+11" [email protected] Excel Discussion (Misc queries) 2 August 12th 08 03:13 PM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
anyone ever hear of a formula beginning "xlend"? excelmix Excel Discussion (Misc queries) 3 September 11th 06 02:00 PM
Complex if test program possible? If "value" "value", paste "value" in another cell? jseabold Excel Discussion (Misc queries) 1 January 30th 06 10:01 PM


All times are GMT +1. The time now is 04:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"