Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Printing labels from excel worksheet

I'm sure this is a very simple question but it's still beyond me - so
I'd be grateful for any help anyne can offer.

I have an Excel spreadsheet with several thousand records of computer
parts. Each record has a unique identifier of 5 or 6 alphanumeric
characters eg 3T453. There are four other fields which describe the
item.

For example, a line looks like this:-
3T453 Compaq Deskpro 410 23/12/2004 12

What I need is a method to search through the database by typing in
the identifier ('3T453') and then when the appropriate record is
found, to lift out the five bits of information and print them on a
label in a much larger font

eg

3T453
Compaq
Deskpro 410
23/12/2004
12

Then I'd like to be able to input another identifier - and so on.

I can record a macro to do most of this this in a rather amateur and
static way by first using 'Edit/Find' but I don't know how to write
the code to invoke a macro that will do the whole lot more seamlessly.

I hope this make sense and that someone can tell me how to do it!

Many thanks for any help.

PS: I would have looked through the existing posts, but as there are
over 350 000 of them, I just don't have the time, as I will be
retiring in the next couple of years.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Printing labels from excel worksheet

Sub PrintLabel()
Dim rng as Range, rng1 as Range
Dim ans as String
with worksheets("Data")
set rng = .Range(.Cells(2,1),.Cells(2,1).End(xldown))
end with
ans = InputBox("enter unique identifier")
set rng1 = rng.Find(What:=ans, _
After:=rng(rng.count), _
LookIn:=xlFormulas, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
if not rng1 is nothing then
rng1.Resize(1,4).Copy
With worksheets("Printout")
.Range("A1").PasteSpecial xlValues, Transpose:=True
.Range("A1:A5").Printout
.Range("A1:A5").ClearContents
End with
End if
End Sub

have the printout range A1:A5 on sheet Printout preformatted for the font
and other format settings you want.

--
Regards,
Tom Ogilvy

"Emlyn Whitley" wrote in message
...
I'm sure this is a very simple question but it's still beyond me - so
I'd be grateful for any help anyne can offer.

I have an Excel spreadsheet with several thousand records of computer
parts. Each record has a unique identifier of 5 or 6 alphanumeric
characters eg 3T453. There are four other fields which describe the
item.

For example, a line looks like this:-
3T453 Compaq Deskpro 410 23/12/2004 12

What I need is a method to search through the database by typing in
the identifier ('3T453') and then when the appropriate record is
found, to lift out the five bits of information and print them on a
label in a much larger font

eg

3T453
Compaq
Deskpro 410
23/12/2004
12

Then I'd like to be able to input another identifier - and so on.

I can record a macro to do most of this this in a rather amateur and
static way by first using 'Edit/Find' but I don't know how to write
the code to invoke a macro that will do the whole lot more seamlessly.

I hope this make sense and that someone can tell me how to do it!

Many thanks for any help.

PS: I would have looked through the existing posts, but as there are
over 350 000 of them, I just don't have the time, as I will be
retiring in the next couple of years.



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
Printing labels from excel worksheet [email protected] Excel Programming 0 September 23rd 06 03:19 PM
PRINTING LABELS FROM EXCELL WORKSHEET NORFUS New Users to Excel 3 May 12th 06 03:17 AM
Printing labels from excel Linda Excel Discussion (Misc queries) 1 November 12th 05 04:11 PM
printing labels through excel DB1972 Excel Discussion (Misc queries) 1 June 1st 05 06:38 PM
Printing Labels using Excel L ance Excel Programming 0 March 8th 05 09:56 PM


All times are GMT +1. The time now is 11:24 PM.

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

About Us

"It's about Microsoft Excel"