Find a word and print only to that poing

south0085

Board Regular
Joined
Aug 15, 2011
Messages
141
*Point. Not poing.

Thank you for your time. I have a sheet in excel that has many sections of places for me to enter data. Each time our paint department enters data, I put that color and qty and such into a new section. By the end of entering all the data, I have many pages that need to be printed. However, if I just hit print, it prints ALL my sections. But i only want to print the sections that have data into them.

I tried this: I created a cell at the bottom of each "section" and if it's my last section of data I put the word "last" in that cell. Then I tried recording a macro that finds the word "last" and then copies from that cell all the way up to the top and prints the selected data. But that didn't work. It wasn't looking at the word "last". If I changed the location of "last", the macro would still go to the original location i used when I recorded the macro.

Anyways, can someone help me? Here's what my sheet looks like, except there's a lot more sections of data below this. And wow. I'm sorry this is so zoomed-in. I don't know how to fix it.

Production Schedule

*ABCIJLNOPRSTU
1*************
6Production Schedule for P3 (Load,Unload,Dustbox,Dandori,QC,PH)*****DATE*X 1**
7*************
8Lot#ModelColorPart NameSideQTY# of ShaftsCompletion Time in minsShiftCommentsQCINSPBUFF
9
10****00*****
11*Blend:*00*00*****
12*(Summer or Winter)*00*00*****
13***00*00*****
14***00*00*****
15***00*00*****
16***00*00*****
17***00*00*****
18***00*00*****
19***00*00*****
20****00*****
21****00*****
22******Line Time0*****
23****00*****
24*Blend:*00*00*****
25*(Summer or Winter)*00*00*****
26***00*00*****
27***00*00*****
28***00*00*****
29***00*00*****
30***00*00*****
31***00*00*****
32***00*00*****
33****00*****
34****00*****
35Last*****Line Time0*****

<tbody>
</tbody>

Spreadsheet Formulas
CellFormula
I10=IF(ISERROR(VLOOKUP(H10,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H10,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J10=IF(ISERROR(VLOOKUP(H10,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H10,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N10=IF(L10=0,0,L10/M10)
O10=N10/4
I11=IF(ISERROR(VLOOKUP(H11,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H11,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J11=IF(ISERROR(VLOOKUP(H11,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H11,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N11=IF(L11=0,0,L11/M11)
O11=N11/4
I12=IF(ISERROR(VLOOKUP(H12,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H12,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J12=IF(ISERROR(VLOOKUP(H12,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H12,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N12=IF(L12=0,0,L12/M12)
O12=N12/4
I13=IF(ISERROR(VLOOKUP(H13,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H13,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J13=IF(ISERROR(VLOOKUP(H13,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H13,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N13=IF(L13=0,0,L13/M13)
O13=N13/4
I14=IF(ISERROR(VLOOKUP(H14,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H14,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J14=IF(ISERROR(VLOOKUP(H14,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H14,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N14=IF(L14=0,0,L14/M14)
O14=N14/4
I15=IF(ISERROR(VLOOKUP(H15,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H15,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J15=IF(ISERROR(VLOOKUP(H15,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H15,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N15=IF(L15=0,0,L15/M15)
O15=N15/4
I16=IF(ISERROR(VLOOKUP(H16,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H16,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J16=IF(ISERROR(VLOOKUP(H16,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H16,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N16=IF(L16=0,0,L16/M16)
O16=N16/4
I17=IF(ISERROR(VLOOKUP(H17,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H17,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J17=IF(ISERROR(VLOOKUP(H17,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H17,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N17=IF(L17=0,0,L17/M17)
O17=N17/4
I18=IF(ISERROR(VLOOKUP(H18,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H18,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J18=IF(ISERROR(VLOOKUP(H18,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H18,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N18=IF(L18=0,0,L18/M18)
O18=N18/4
I19=IF(ISERROR(VLOOKUP(H19,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H19,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J19=IF(ISERROR(VLOOKUP(H19,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H19,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N19=IF(L19=0,0,L19/M19)
O19=N19/4
I20=IF(ISERROR(VLOOKUP(H20,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H20,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J20=IF(ISERROR(VLOOKUP(H20,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H20,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N20=IF(L20=0,0,L20/M20)
O20=N20/4
I21=IF(ISERROR(VLOOKUP(H21,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H21,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J21=IF(ISERROR(VLOOKUP(H21,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H21,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N21=IF(L21=0,0,L21/M21)
O21=N21/4
O22=Q22
I23=IF(ISERROR(VLOOKUP(H23,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H23,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J23=IF(ISERROR(VLOOKUP(H23,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H23,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N23=IF(L23=0,0,L23/M23)
O23=N23/4
I24=IF(ISERROR(VLOOKUP(H24,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H24,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J24=IF(ISERROR(VLOOKUP(H24,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H24,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N24=IF(L24=0,0,L24/M24)
O24=N24/4
I25=IF(ISERROR(VLOOKUP(H25,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H25,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J25=IF(ISERROR(VLOOKUP(H25,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H25,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N25=IF(L25=0,0,L25/M25)
O25=N25/4
I26=IF(ISERROR(VLOOKUP(H26,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H26,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J26=IF(ISERROR(VLOOKUP(H26,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H26,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N26=IF(L26=0,0,L26/M26)
O26=N26/4
I27=IF(ISERROR(VLOOKUP(H27,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H27,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J27=IF(ISERROR(VLOOKUP(H27,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H27,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N27=IF(L27=0,0,L27/M27)
O27=N27/4
I28=IF(ISERROR(VLOOKUP(H28,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H28,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J28=IF(ISERROR(VLOOKUP(H28,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H28,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N28=IF(L28=0,0,L28/M28)
O28=N28/4
I29=IF(ISERROR(VLOOKUP(H29,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H29,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J29=IF(ISERROR(VLOOKUP(H29,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H29,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N29=IF(L29=0,0,L29/M29)
O29=N29/4
I30=IF(ISERROR(VLOOKUP(H30,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H30,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J30=IF(ISERROR(VLOOKUP(H30,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H30,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N30=IF(L30=0,0,L30/M30)
O30=N30/4
I31=IF(ISERROR(VLOOKUP(H31,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H31,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J31=IF(ISERROR(VLOOKUP(H31,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H31,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N31=IF(L31=0,0,L31/M31)
O31=N31/4
I32=IF(ISERROR(VLOOKUP(H32,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H32,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J32=IF(ISERROR(VLOOKUP(H32,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H32,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N32=IF(L32=0,0,L32/M32)
O32=N32/4
I33=IF(ISERROR(VLOOKUP(H33,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H33,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J33=IF(ISERROR(VLOOKUP(H33,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H33,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N33=IF(L33=0,0,L33/M33)
O33=N33/4
I34=IF(ISERROR(VLOOKUP(H34,'Winter Data Sheet'!$D$7:$G$1098,3,0))," ",VLOOKUP(H34,'Winter Data Sheet'!$D$7:$G$1098,3,0))
J34=IF(ISERROR(VLOOKUP(H34,'Winter Data Sheet'!$D$7:$G$1098,4,0))," ",VLOOKUP(H34,'Winter Data Sheet'!$D$7:$G$1098,4,0))
N34=IF(L34=0,0,L34/M34)
O34=N34/4
O35=Q35

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Last edited:

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Hi there

I would suggest that you take a look at using filters. You could have a column that looks at a specific cell and then returns a character you could use for the filter. The print range would exclude that column
 
Upvote 0
Thank you. I did what you said. I created a column that returns the word "print". Then I recorded a macro that filters for the word "print" then prints the data. But I'm getting this error:

Code:
Sub Loading()
'
' Loading Macro
'

'
    Range("A1").Select
    ActiveSheet.Range("$A$1:$DL$1030").AutoFilter Field:=1, Criteria1:="Print"
    Columns("B:V").Select
    Selection.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
    Range("A2").Select
    ActiveSheet.Range("$A$1:$DL$1030").AutoFilter Field:=1
    Range("A1").Select
End Sub
[code]

*The line that says:  "Selection.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False" is highlighted yellow.
 
Upvote 0
My VBA is poor at best :( Have you tried to print manually? Maybe if you create a named range for the print range, you could use that in the macro?
 
Upvote 0
I may be missing something here, but why not highlight the area you want to print.....and then simply select Print / Print Selection ??
 
Upvote 0
I want to create a macro button that the person using this sheet can just press when they want to print. I've been given the task where I work of improving the speed of every job this particular person does.
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,748
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top