Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I auto transform sets of data? (change "female" to "f") | Excel Discussion (Misc queries) | |||
text string: "91E10" in csv file auto converts to: "9.10E+11" | Excel Discussion (Misc queries) | |||
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell | Excel Discussion (Misc queries) | |||
anyone ever hear of a formula beginning "xlend"? | Excel Discussion (Misc queries) | |||
Complex if test program possible? If "value" "value", paste "value" in another cell? | Excel Discussion (Misc queries) |