Thread: tales of woe
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default tales of woe

I had a typo - here is a revision:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row 1 Then
If Target.Offset(0, 1) = "" Then
Target.Offset(0, 1).Value = Date
Target.Offset(0, 1).NumberFormat = "mm/dd/yyyy"
End If
End If
End Sub


--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
Depends on how your barcode scanner is transmitting the information to
excel. If it is simulating keyboard input, then you would activate the

cell
where you want the input. You would then use the change event to place a
time in the adjacent cell.

Right click on the sheet tab and select view code. Put in code similar

to
this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count 1 then exit sub
If Target.Column = 1 And Target.Row 1 Then
If Target.Offset(0, 1) = "" Then
Target.Offset(0, 1).Value = Date
Target.Offset(0, 1).NumberFormat = "mm/dd/yyyy"
End If
Next
End Sub

--
Regards,
Tom Ogilvy


"sds" wrote in message
...
I have a barcode scanner that scans information into
excel, but in the first cell, A1. I want to create a
spreadsheet so A1 will be a title (e.g.Barcode) how can i
get it to scan straight into A2. Also how can then i get a
time logged into the next box B2 every time i scan a
barcode??
Thanks in advance