Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Auto Detect Data, Auto Print Data, Auto Erase Data Loop

On Sep 12, 8:49*pm, Ron Rosenfeld wrote:
On Mon, 12 Sep 2011 17:38:46 -0700 (PDT), GammaRuit wrote:
I can program my barcode generator to print out something specific as
the very last line of the decode. Maybe END or COMPLETE or THANK YOU


How do you get the information into Excel?

I'm thinking you could just run a test after each line, and print out the range after you read or Last Line code; adapting from what I've already written.



I click A1

I take my scanner scan a QR Code. say my QR is encoded with:

Hi
How
Are
You


It prints it out line by line as it you were typing really fast.

A1 Hi
A2 How
A3 Are
A4 You
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Auto Detect Data, Auto Print Data, Auto Erase Data Loop

On Mon, 12 Sep 2011 18:08:06 -0700 (PDT), GammaRuit wrote:

I click A1

I take my scanner scan a QR Code. say my QR is encoded with:

Hi
How
Are
You


It prints it out line by line as it you were typing really fast.

A1 Hi
A2 How
A3 Are
A4 You


How does the information get from the scanner to your Excel worksheet?
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Auto Detect Data, Auto Print Data, Auto Erase Data Loop

On Mon, 12 Sep 2011 18:08:06 -0700 (PDT), GammaRuit wrote:

On Sep 12, 8:49*pm, Ron Rosenfeld wrote:
On Mon, 12 Sep 2011 17:38:46 -0700 (PDT), GammaRuit wrote:
I can program my barcode generator to print out something specific as
the very last line of the decode. Maybe END or COMPLETE or THANK YOU


How do you get the information into Excel?

I'm thinking you could just run a test after each line, and print out the range after you read or Last Line code; adapting from what I've already written.



I click A1

I take my scanner scan a QR Code. say my QR is encoded with:

Hi
How
Are
You


It prints it out line by line as it you were typing really fast.

A1 Hi
A2 How
A3 Are
A4 You


Although with a better description of your interface, we might be able to do something more efficient, try this (entered the same as the previous):
Note that sLastLine can be defined as you like and that it is case-sensitive

=======================
ption Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rBarCodeData As Range
Dim AOI As Range
Const sLastLine As String = "END"
Set AOI = Range("A:A")

Application.EnableEvents = False

If Not Intersect(Target, AOI) Is Nothing And _
Target.Value = sLastLine Then
Set rBarCodeData = Range("A1", Cells(Cells.Rows.Count, "A").End(xlUp))
With rBarCodeData
.PrintOut Preview:=True
.ClearContents
End With

With Range("A1")
.Activate
.Show
End With

End If
Application.EnableEvents = True
End Sub
========================
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Auto Detect Data, Auto Print Data, Auto Erase Data Loop

Works Ron ! Thank You

Do I need to Define A Header and Footer within the Macro?
I tried to apply it in the layout and it won't work.

What would be a better description of the interface be? The type of
Scanner?
Would you like to see a video of how it works so you can understand
the process?

Chris

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Auto Detect Data, Auto Print Data, Auto Erase Data Loop

On Mon, 12 Sep 2011 19:18:02 -0700 (PDT), GammaRuit wrote:

Works Ron ! Thank You

Do I need to Define A Header and Footer within the Macro?
I tried to apply it in the layout and it won't work.

What would be a better description of the interface be? The type of
Scanner?
Would you like to see a video of how it works so you can understand
the process?

Chris


Glad you've got it working.

So far as the Header and Footer are concerned, I don't understand why you cannot set it up in the "layout". I can go to the Page Layout tab of my ribbon; select Print Titles; enter header and footer; and it "sticks".

If you want to set it up in the macro, you certainly can, but it shouldn't be necessary:
=========================
Option Explicit

Private Sub Worksheet_Change(ByVal Target As Range)
Dim rBarCodeData As Range
Dim AOI As Range
Const sLastLine As String = "END"
Set AOI = Range("A:A")

Application.EnableEvents = False

If Not Intersect(Target, AOI) Is Nothing And _
Target.Value = sLastLine Then
Set rBarCodeData = Range("A1", Cells(Cells.Rows.Count, "A").End(xlUp))
With rBarCodeData
With .Worksheet.PageSetup
.CenterHeader = "": .RightHeader = ""
.CenterFooter = "": .RightFooter = ""
.LeftHeader = "This is my Barcode output"
.LeftFooter = "Printed at " & Format(Date, "Short Date") & _
" " & Format(Time, "h:mm AM/PM")
End With
.PrintOut Preview:=True
.ClearContents
End With

With Range("A1")
.Activate
.Show
End With

End If
Application.EnableEvents = True
End Sub
=============================

So far as the interface is concerned, all you've written is that you scan something in and it appears in your Excel instance in certain cells.

That is not sufficient information for anyone to reproduce what you are doing. For example, if I have a computer here, turn it on and run Excel, and then run a scanner, nothing will appear in my Excel.

There has to be something going on that routes the information from the scanner to a particular instance of Excel, and directs it towards the sequential cells. This usually involves a VBA macro, or some other code.

However, since you seem to have the macro working satisfactorily, there is no need to go further. (Perfect is the enemy of "good enough"). But if you can't define a header or footer, even within the macro, there is possibly something in those routines that is interfering. In that case we would have to know all the details.


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Auto Detect Data, Auto Print Data, Auto Erase Data Loop

I wasn't seeing the header and footer because i didn't input the data
on the left header.
I'm using a receipt printer right now so it was off the page.

So i put the header and footer on the left and it prints. but it moves
into where my data is printing as well.
it is overlapping slightly. i would assume i just have to play with
formatting? nothing to do with macro code right?

cv
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,045
Default Auto Detect Data, Auto Print Data, Auto Erase Data Loop

On Wed, 14 Sep 2011 05:40:48 -0700 (PDT), GammaRuit wrote:

I wasn't seeing the header and footer because i didn't input the data
on the left header.
I'm using a receipt printer right now so it was off the page.

So i put the header and footer on the left and it prints. but it moves
into where my data is printing as well.
it is overlapping slightly. i would assume i just have to play with
formatting? nothing to do with macro code right?

cv


I don't think it has to do with macro code. Playing with formatting might work, maybe a larger margin. Or there may be something in your printer driver.
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
Auto show data but without using Auto Filter LP Excel Discussion (Misc queries) 1 April 8th 09 12:06 AM
auto transfer data in sheet2 (selected data) deen Excel Worksheet Functions 1 May 9th 08 01:57 PM
how to auto-print if data is on report after each sort? Steve Excel Programming 0 October 29th 07 03:33 PM
Auto-populate, Auto-copy or Auto-fill? Jay S. Excel Worksheet Functions 4 August 10th 07 09:04 PM
How can I auto-refresh auto-filters when data changes? Mike@MPWco Excel Worksheet Functions 0 July 4th 06 12:50 PM


All times are GMT +1. The time now is 12:33 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"