ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Avoid printing blank columns (https://www.excelbanter.com/excel-programming/284511-avoid-printing-blank-columns.html)

Robbyn[_2_]

Avoid printing blank columns
 
Hi all! First time post to the newsgroup, but I've used the suggestions posted here many, many times to help me with Excel troubles. I'm not a programmer, but sometimes I copy and paste code to help me solve my problems. Not sure if this is the proper newsgroup to introduce this thread, so my apologies if it isn't

I'm a teacher/tech coordinator and I'm trying to design a very user-friendly gradesheet for teachers. I've modified a template downloaded from Microsoft, and I would like to include a command button which produces a printable page of everything EXCEPT blank columns in a certain range

Gradesheet looks something like this

A17-E17 includes Student names, Average, etc

F17+ is comprised of assignments/tests

The # of columns with data will constantly be changing. Any help would be appreciated.

BTW, excellent newsgroup. Thanks for ALL the help you've inadvertently given me




GJones

Avoid printing blank columns
 
robbyn;

Try the sub

Sub try()

Range("A1").Select
Selection.CurrentRegion.Select
Selection.PrintOut Copies:=1, Collate:=True
End Sub

Thanks,

Greg



-----Original Message-----
Hi all! First time post to the newsgroup, but I've used

the suggestions posted here many, many times to help me
with Excel troubles. I'm not a programmer, but sometimes
I copy and paste code to help me solve my problems. Not
sure if this is the proper newsgroup to introduce this
thread, so my apologies if it isn't.

I'm a teacher/tech coordinator and I'm trying to design a

very user-friendly gradesheet for teachers. I've modified
a template downloaded from Microsoft, and I would like to
include a command button which produces a printable page
of everything EXCEPT blank columns in a certain range.

Gradesheet looks something like this:

A17-E17 includes Student names, Average, etc.

F17+ is comprised of assignments/tests

The # of columns with data will constantly be changing.

Any help would be appreciated.

BTW, excellent newsgroup. Thanks for ALL the help you've

inadvertently given me!




.


Don Guillett[_4_]

Avoid printing blank columns
 
try this. modify to suit.

Sub hidecolsandprint()
For Each c In Range("a1:i1")
If Application.CountA(c.EntireColumn) = 0 Then _
c.EntireColumn.Hidden = True
Next
ActiveSheet.PrintPreview
Columns("a:i").Hidden = False
End Sub


--
Don Guillett
SalesAid Software

"Robbyn" wrote in message
...
Hi all! First time post to the newsgroup, but I've used the suggestions

posted here many, many times to help me with Excel troubles. I'm not a
programmer, but sometimes I copy and paste code to help me solve my
problems. Not sure if this is the proper newsgroup to introduce this
thread, so my apologies if it isn't.

I'm a teacher/tech coordinator and I'm trying to design a very

user-friendly gradesheet for teachers. I've modified a template downloaded
from Microsoft, and I would like to include a command button which produces
a printable page of everything EXCEPT blank columns in a certain range.

Gradesheet looks something like this:

A17-E17 includes Student names, Average, etc.

F17+ is comprised of assignments/tests

The # of columns with data will constantly be changing. Any help would be

appreciated.

BTW, excellent newsgroup. Thanks for ALL the help you've inadvertently

given me!







Don Guillett[_4_]

Avoid printing blank columns
 
Did you test to see if columns beyond the blank columns printed?
BTW, your code could be

Range("A1").CurrentRegion.Printout

--
Don Guillett
SalesAid Software

"GJones" wrote in message
...
robbyn;

Try the sub

Sub try()

Range("A1").Select
Selection.CurrentRegion.Select
Selection.PrintOut Copies:=1, Collate:=True
End Sub

Thanks,

Greg



-----Original Message-----
Hi all! First time post to the newsgroup, but I've used

the suggestions posted here many, many times to help me
with Excel troubles. I'm not a programmer, but sometimes
I copy and paste code to help me solve my problems. Not
sure if this is the proper newsgroup to introduce this
thread, so my apologies if it isn't.

I'm a teacher/tech coordinator and I'm trying to design a

very user-friendly gradesheet for teachers. I've modified
a template downloaded from Microsoft, and I would like to
include a command button which produces a printable page
of everything EXCEPT blank columns in a certain range.

Gradesheet looks something like this:

A17-E17 includes Student names, Average, etc.

F17+ is comprised of assignments/tests

The # of columns with data will constantly be changing.

Any help would be appreciated.

BTW, excellent newsgroup. Thanks for ALL the help you've

inadvertently given me!




.




Robbyn[_2_]

Avoid printing blank columns
 
Thank you both for your quick response. Both the print preview (Don's code) and the automatic print (Greg's code) worked, but neither hid the columns. I reproduced what you both did on a new "practice" sheet, and they both worked great. I'm wondering if the problem on my gradesheet is that the bottom rows contain formulas for calculating class averages, as well as min./max scores for each assignment? I tried both codes on a "clean" gradesheet template from Microsoft. They both worked on one that had no formulas at the end of the sheet, but not the other

A1:AH - Student names, averages, assignments, etc

A60-63:AH60-63 - Class summary inf




Don Guillett[_4_]

Avoid printing blank columns
 
I'm wondering if the problem on my gradesheet is that the bottom rows
contain formulas

Your original request did say BLANK columns. Restate your request with what
you really want. Where is the bottom row?

I don't understand these ranges. Perhaps you could explain.
A1:AH - Student names, averages, assignments, etc.
A60-63:AH60-63 - Class summary info


--
Don Guillett
SalesAid Software

"Robbyn" wrote in message
...
Thank you both for your quick response. Both the print preview (Don's

code) and the automatic print (Greg's code) worked, but neither hid the
columns. I reproduced what you both did on a new "practice" sheet, and they
both worked great. I'm wondering if the problem on my gradesheet is that
the bottom rows contain formulas for calculating class averages, as well as
min./max scores for each assignment? I tried both codes on a "clean"
gradesheet template from Microsoft. They both worked on one that had no
formulas at the end of the sheet, but not the other.

A1:AH - Student names, averages, assignments, etc.

A60-63:AH60-63 - Class summary info







Robbyn[_2_]

Avoid printing blank columns
 
Ok Don, here we go.

A17 B17 C17 D17 - AH17

Student Name Average TotalPoints Assignments
-
-
- (Rows)
-
-
-

ClassSummary
Average - - -
MaxScore - - - (lines indicate a formula for calculating Class summaryinfo
MinScore - - - for each assignment)


Thank you again!




Don Guillett[_4_]

Avoid printing blank columns
 
I still don't understand your need. I guess you need to send me a small
workbook with a DETAILED explanation. Getting old you know.

--
Don Guillett
SalesAid Software

"Robbyn" wrote in message
...
Ok Don, here we go.

A17 B17 C17 D17 - AH17

Student Name Average TotalPoints Assignments
-
-
- (Rows)
-
-
-

ClassSummary
Average - - -
MaxScore - - -

(lines indicate a formula for calculating Class summaryinfo
MinScore - - -

for each assignment)


Thank you again!






Robbyn[_2_]

Avoid printing blank columns
 
E-mail sent. I apologize for the confusion.

Don Guillett[_4_]

Avoid printing blank columns
 
didn't get it.
sent to?

--
Don Guillett
SalesAid Software

"Robbyn" wrote in message
...
E-mail sent. I apologize for the confusion.




Robbyn[_2_]

Avoid printing blank columns
 
Sent to the email address listed under your sig. Sent again using my other email account - the school email is twitchy.



Don Guillett[_4_]

Avoid printing blank columns
 
got it

--
Don Guillett
SalesAid Software

"Robbyn" wrote in message
...
Sent to the email address listed under your sig. Sent again using my

other email account - the school email is twitchy.






All times are GMT +1. The time now is 10:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com