Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a barcode scanner hooked up to excel. It decodes the encoded
text in the barcode it scans. The barcodes scanned may have up to 40-50 lines and 600 + characters of data. It will all stay in column A and could populate all the way down to line 40-60. I'm trying to write a macro for this with not too much luck. When the information is scanned, the macro needs to start at A1 sense how many cells were populated with data, maybe it fill A1 - A12 or maybe A1-A60, it needs to auto prints those cells, then erases the information that was scanned in and awaits the next scan, and does it all over again until i stop it. It only prints once when it receives new data. Example: Basically its an autoprint as if you were to do a price check in a store. you put the item under a scanner and the screen shows you the price when its scanned, how ever instead of the screen output i want it to print to a printer. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Office Mac 2011
|
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mon, 12 Sep 2011 07:04:57 -0700 (PDT), "Gamma's and Ruiter's" wrote:
I have a barcode scanner hooked up to excel. It decodes the encoded text in the barcode it scans. The barcodes scanned may have up to 40-50 lines and 600 + characters of data. It will all stay in column A and could populate all the way down to line 40-60. I'm trying to write a macro for this with not too much luck. When the information is scanned, the macro needs to start at A1 sense how many cells were populated with data, maybe it fill A1 - A12 or maybe A1-A60, it needs to auto prints those cells, then erases the information that was scanned in and awaits the next scan, and does it all over again until i stop it. It only prints once when it receives new data. Example: Basically its an autoprint as if you were to do a price check in a store. you put the item under a scanner and the screen shows you the price when its scanned, how ever instead of the screen output i want it to print to a printer. Does your version of Excel support VBA? Perhaps you can work with this event-triggered macro. It assumes that all of the data is pasted in at once. If it is read in line-by-line, then you'll need a different "trigger" to know when the reading in has finished. I have enabled print preview for debugging, but you don't need this. To enter this event-triggered Macro, right click on the sheet tab. Select "View Code" from the right-click drop-down menu. Then paste the code below into the window that opens. =========================================== Option Explicit Private Sub Worksheet_Change(ByVal Target As Range) Dim rBarCodeData As Range Set rBarCodeData = Range("A1", Cells(Cells.Rows.Count, "A").End(xlUp)) Application.EnableEvents = False If Not Intersect(Target, rBarCodeData) Is Nothing Then With rBarCodeData .PrintOut Preview:=True .ClearContents End With End If Application.EnableEvents = True End Sub =============================== |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
this works but if i have a scan come in thats say 11 lines long it
prints 1 line then it prints the next. doesn't wait for the whole scan to come in to print it. also it doesn't go back to a1 with the blinking cursor to await the next input. close though.. any ideas? cv |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mon, 12 Sep 2011 15:08:28 -0700 (PDT), GammaRuit wrote:
this works but if i have a scan come in thats say 11 lines long it prints 1 line then it prints the next. doesn't wait for the whole scan to come in to print it. As I indicated in my initial response, "If it is read in line-by-line, then you'll need a different "trigger" to know when the reading in has finished." You have not provided any information regarding this. also it doesn't go back to a1 with the blinking cursor to await the next input. I wasn't aware that Mac versions of Excel have "blinking cursor". Why do you require this? If you want to return to A1, you can add something like: With Range("A1") .Activate .Show End With to the end of the macro. close though.. any ideas? Not with the information you have so far supplied. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Apologies Ron,
1. Its read in line by line. 2. Your right about the blinking cursor. It just blinks when I double click the cell. Forget that. I just want to go back to A1 as you showed me how in the previous message. cv |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Mon, 12 Sep 2011 17:13:44 -0700 (PDT), GammaRuit wrote:
1. Its read in line by line. How do you know when the last line has been read in? |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
my version does support VBA
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Auto show data but without using Auto Filter | Excel Discussion (Misc queries) | |||
auto transfer data in sheet2 (selected data) | Excel Worksheet Functions | |||
how to auto-print if data is on report after each sort? | Excel Programming | |||
Auto-populate, Auto-copy or Auto-fill? | Excel Worksheet Functions | |||
How can I auto-refresh auto-filters when data changes? | Excel Worksheet Functions |