#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Print Row

I am searching for code that I can attach to a checkbox
that will not allow a referenced row to be printed. Any
advice?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Print Row

You would have to write code to hide the row in order for it not to be
printed. Also, how would you "reference" a row from a checkbox? You would
probably need to use a linked cell to identify the row that you want to
suppress.

--

Vasant


"nman" wrote in message
...
I am searching for code that I can attach to a checkbox
that will not allow a referenced row to be printed. Any
advice?



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Print Row

New to this but I do understand your comments. Not sure
what the code should be to not print a row (or range).

-----Original Message-----
You would have to write code to hide the row in order

for it not to be
printed. Also, how would you "reference" a row from a

checkbox? You would
probably need to use a linked cell to identify the row

that you want to
suppress.

--

Vasant


"nman" wrote in

message
...
I am searching for code that I can attach to a checkbox
that will not allow a referenced row to be printed.

Any
advice?



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Print Row

Try this
http://www.rondebruin.nl/print.htm#Hide



--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message ...
New to this but I do understand your comments. Not sure
what the code should be to not print a row (or range).

-----Original Message-----
You would have to write code to hide the row in order

for it not to be
printed. Also, how would you "reference" a row from a

checkbox? You would
probably need to use a linked cell to identify the row

that you want to
suppress.

--

Vasant


"nman" wrote in

message
...
I am searching for code that I can attach to a checkbox
that will not allow a referenced row to be printed.

Any
advice?



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Print Row

I need to attach the code (for each individual row) to
a "checkbox" so I can select the rows I don't want
printed. I do not want the row to disappear or "hide"
from the worksheet, just not print if the checkbox
contains a check.

-----Original Message-----
Try this
http://www.rondebruin.nl/print.htm#Hide



--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message

...
New to this but I do understand your comments. Not

sure
what the code should be to not print a row (or range).

-----Original Message-----
You would have to write code to hide the row in order

for it not to be
printed. Also, how would you "reference" a row from a

checkbox? You would
probably need to use a linked cell to identify the row

that you want to
suppress.

--

Vasant


"nman" wrote in

message
...
I am searching for code that I can attach to a

checkbox
that will not allow a referenced row to be printed.

Any
advice?


.



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Print Row

As I stated in my initial response, you have to hide the row if you don't
want to print it. There is no other practical way.

--

Vasant

"nman" wrote in message
...
I need to attach the code (for each individual row) to
a "checkbox" so I can select the rows I don't want
printed. I do not want the row to disappear or "hide"
from the worksheet, just not print if the checkbox
contains a check.

-----Original Message-----
Try this
http://www.rondebruin.nl/print.htm#Hide



--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message

...
New to this but I do understand your comments. Not

sure
what the code should be to not print a row (or range).

-----Original Message-----
You would have to write code to hide the row in order
for it not to be
printed. Also, how would you "reference" a row from a
checkbox? You would
probably need to use a linked cell to identify the row
that you want to
suppress.

--

Vasant


"nman" wrote in
message
...
I am searching for code that I can attach to a

checkbox
that will not allow a referenced row to be printed.
Any
advice?


.



.



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Print Row

I tried the code for "Hide Rows or Cells when you print a
sheet" and it did not work for me.

-----Original Message-----
Try this
http://www.rondebruin.nl/print.htm#Hide



--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message

...
New to this but I do understand your comments. Not

sure
what the code should be to not print a row (or range).

-----Original Message-----
You would have to write code to hide the row in order

for it not to be
printed. Also, how would you "reference" a row from a

checkbox? You would
probably need to use a linked cell to identify the row

that you want to
suppress.

--

Vasant


"nman" wrote in

message
...
I am searching for code that I can attach to a

checkbox
that will not allow a referenced row to be printed.

Any
advice?


.



.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Print Row

Here's a possible solution:

1. Use checkboxes from the Forms Toolbar; not the Control Toolbox (the
former are more stable when used on worksheets). Ypu will probably want to
uncheck "Print Object" in the Format Control dialog.

2. Right-click on each one and set its LinkedCell property to a cell in the
row that the checkbox relates to (say in column Z, if that's far enough
out). You can even hide the column as it serves no purpose other than to
carry the value of the checkboxes.

3. Put the following code in the ThisWorkbook code module:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim c As Range
With ActiveSheet
For Each c In Intersect(.UsedRange, .Range("Z:Z"))
If c = True Then c.EntireRow.Hidden = True
Next
Application.EnableEvents = False
On Error GoTo ErrorHandler
.PrintOut
Application.EnableEvents = True
End With
ErrorHandler:
MsgBox "Error " & Err.Number & vbNewLine & Err.Description, _
vbOKOnly + vbCritical, "Error"
ActiveSheet.UsedRange.EntireRow.Hidden = False
Application.EnableEvents = True
End Sub

It's really pretty messy but hopefully will put you on the right track.

--

Vasant







"nman" wrote in message
...
I tried the code for "Hide Rows or Cells when you print a
sheet" and it did not work for me.

-----Original Message-----
Try this
http://www.rondebruin.nl/print.htm#Hide



--
Regards Ron de Bruin
http://www.rondebruin.nl


wrote in message

...
New to this but I do understand your comments. Not

sure
what the code should be to not print a row (or range).

-----Original Message-----
You would have to write code to hide the row in order
for it not to be
printed. Also, how would you "reference" a row from a
checkbox? You would
probably need to use a linked cell to identify the row
that you want to
suppress.

--

Vasant


"nman" wrote in
message
...
I am searching for code that I can attach to a

checkbox
that will not allow a referenced row to be printed.
Any
advice?


.



.



  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Print Row

It might be to use Data|filter|Autofilter.

Apply the filter to a column and show only the rows you want to print.

I'd drop the checkboxes and use a simple X in that column of cells.
(Filter by Blanks or non-blanks)

But you could make each checkbox link to a cell in that row.
(Then you'd filter by True/False)

(if you exclude that column from the print range, it'll look ok.)

A little extra work, but I think it's easier.



nman wrote:

I am searching for code that I can attach to a checkbox
that will not allow a referenced row to be printed. Any
advice?


--

Dave Peterson

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
Print and Print Preview Graphic Moving Resizing 2007/2003 Adam Rayburn Excel Discussion (Misc queries) 0 April 4th 07 04:18 PM
cell borders that I create dont show on print preview or print scott3435 Excel Discussion (Misc queries) 2 April 6th 06 02:37 AM
Pivot Table macro to set print area and print details of drill down data Steve Haskins Excel Discussion (Misc queries) 2 December 28th 05 04:59 PM
Active cell counting in particular print page (one sheet having different print area) ananthmca2004 Excel Worksheet Functions 1 November 24th 05 11:29 AM
Macro to open print window and set to print entire workbook retseort Excel Discussion (Misc queries) 1 October 27th 05 11:00 PM


All times are GMT +1. The time now is 01:51 AM.

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"