Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Ignoring blanks from Column(s) | Excel Worksheet Functions | |||
Replace all non blanks in a column with column header | Excel Discussion (Misc queries) | |||
Creating a column of numbers from a column with some blanks? | Excel Discussion (Misc queries) | |||
Detecting Blanks and Non Text Characters. | Excel Worksheet Functions | |||
characters that do not print | Excel Programming |