Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Print If Column Contains Blanks (No Characters)

Update From Nancy

Well a lot has happened today, lost all of my Macros twice.

Confused by All Workbooks, This WorkBook and Valdezcls Workbook.

I had to rekey everything, but most of it was from different users. Here is
my current code

Dim wks As Worksheet ' Current Sheet
Dim lls As Workbook
Dim wsl As Worksheet ' Work Sheet in Memory
Dim rng As Range
Dim FSJS As String
Dim FSJSNo As Long
Dim HSCrs As String
Dim HSCrsNo As Long

Set wkst = ActiveSheet

FSJS = InputBox("Enter Grade, Class, or 5-A On Student, Column
Heading")
ColNum = Columns(FSJS & ":" & FSJS).Column
HSCrs = InputBox("Enter the Column for the Course to be Reviewed")
HSCrsNo = Columns(HSCrs & ":" & HSCrs).Column

Set lls = Workbooks.Add(1)
Set wsl = lbls.Worksheets(1)
lls.Title = "Valdez High School"
lls.Subject = "Sophomores"

' Find Errors Routine

If FSJS = "10" then FSJSNo = 19
If FSJS = "5-A" then FSJSNo = 245

With wks
If .AutoFilterMode Then .AutoFilterMode = False
Set rng = .Range("A1").CurrentRegion
With rng
.AutoFilter Field:=FSJSNo, Criteria1:="Sophomore"
.AutoFilter Field:=HSCrsNo, Criteria1:=""
.Columns(FSJS).Copy wslb.Columns(1).Cells(1)
.Columns(249).Copy wslb.Columns(2).Cells(1)
.Columns(251).Copy wslb.Columns(3).Cells(1)
.Columns(252).Copy wslb.Columns(4).Cells(1)
.Columns(253).Copy wslb.Columns(5).Cells(1)
.Columns(254).Copy wslb.Columns(5).Cells(1)
.Columns(HSCrs).Copy wslb.Columns(6).Cells(1)
End With
End With

With wsl.Range("A:G").EntireColumn
.ColumnWidth = 255
.AutoFit
End With

With wkst.PageSetup
.PrintTitleRows = "$1:$1"
.PrintTitleColumns = "$A:$D"
.LeftHeader = ""
'Error .CenterHeader = "&" "Arial,Bold" "Information Missing on Student
Record Report"
.RightHeader = ""
.LeftFooter = "&8&D"
.CenterFooter = ""
.RightFooter = "&8&T"
.LeftMargin = Application.InchesToPoints(0.75)
.RightMargin = Application.InchesToPoints(0.75)
.TopMargin = Application.InchesToPoints(1)
.BottomMargin = Application.InchesToPoints(1)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlLandscape
.Draft = False
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = False
' Error .PrintErrors = xlPrintErrorsDisplayed
End With
' Error ActiveWindow.SelectedSheets.PrintPreview , Collate:=True

wslb.SaveAs Filename:="C:\Valdez\Geography.xls", FileFormat:=xlNormal

The lines marked with ' Error are where I got halts.

Are all of these lines for the printer necessary.
Before I tried to guess what the format was for Print Preview, I lost one
Alaskan Tree.

I want to review the errors before I continue to save a new WorkBook.

Doing better, but still need a lot of help!

Nancy X


Thanks a Bunch Guys

Nancy X.

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
Ignoring blanks from Column(s) Michael Excel Worksheet Functions 3 December 3rd 06 08:58 PM
Replace all non blanks in a column with column header hnyb1 Excel Discussion (Misc queries) 3 April 18th 06 05:39 PM
Creating a column of numbers from a column with some blanks? Knut Excel Discussion (Misc queries) 0 March 20th 06 12:36 AM
Detecting Blanks and Non Text Characters. Alec Kolundzic Excel Worksheet Functions 4 May 26th 05 04:28 PM
characters that do not print matt dunbar Excel Programming 1 October 8th 04 02:14 PM


All times are GMT +1. The time now is 05:27 AM.

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"