G
Guest
Well guys this is my first Excel Experience!
I have to check if Column HSCrs has No Data.
If it does not I print out the Contents of Column 4 and Column 5.
If it does have Data I have to do another print out, but more important
create another Workbook.
The code I have below works so far, except I Do not know where to put my
AutoFilter and How to Check for the Column (HSCrs) having Blanks.
If HSCrs has data, and the Column FSJS Contains "5-A" or "Sophomore" than I
copy that Line to my new WorkBook.
I would like to get a little done so when I get to school tomorrow I can
find out more!
Here is my Code!
Sub Five-A()
Dim wks As Worksheet ' Current Sheet
Dim lls As Workbook
Dim wsl As Worksheet ' Work Sheet
Dim FSJS As String
Dim FSJSNo As Long
Dim HSCrs As String
Dim HSCrsNo As Long
Set wks = ActiveSheet
FSJS = InputBox("Enter the Column for the Class!")
FSJSNo = Columns(FSJS & ":" & FSJS).Column ' Class Col #
HSCrs = InputBox("Enter the Column for Course to be Reviewed!")
HSCrsNo = Columns(HSCrs & ":" & HSCrs).Column ' Course Col #
Set lls = Workbooks.Add
With lls
.Title = "Valdez High School"
.Subject = "Sophomores"
End With
' Selection.AutoFilter Field:=12, Criteria1:="5-A"
Set wsl = ActiveSheet
wks.Columns(FSJS).Copy wsl.Columns(1)
wks.Columns(249).Copy wsl.Columns(2)
wks.Columns(251).Copy wsl.Columns(3)
wks.Columns(252).Copy wsl.Columns(4)
wks.Columns(253).Copy wsl.Columns(5)
wks.Columns(254).Copy wsl.Columns(6)
wks.Columns(HSCrs).Copy wsl.Columns(7)
With wsl.Range("A:H").EntireColumn
.ColumnWidth = 255
.AutoFit
End With
wsl.SaveAs Filename:="C:\Valdez\Geography.xls",
FileFormat:=xlNormal
End Sub
Thanks a Bunch Guys
Nancy X.
I have to check if Column HSCrs has No Data.
If it does not I print out the Contents of Column 4 and Column 5.
If it does have Data I have to do another print out, but more important
create another Workbook.
The code I have below works so far, except I Do not know where to put my
AutoFilter and How to Check for the Column (HSCrs) having Blanks.
If HSCrs has data, and the Column FSJS Contains "5-A" or "Sophomore" than I
copy that Line to my new WorkBook.
I would like to get a little done so when I get to school tomorrow I can
find out more!
Here is my Code!
Sub Five-A()
Dim wks As Worksheet ' Current Sheet
Dim lls As Workbook
Dim wsl As Worksheet ' Work Sheet
Dim FSJS As String
Dim FSJSNo As Long
Dim HSCrs As String
Dim HSCrsNo As Long
Set wks = ActiveSheet
FSJS = InputBox("Enter the Column for the Class!")
FSJSNo = Columns(FSJS & ":" & FSJS).Column ' Class Col #
HSCrs = InputBox("Enter the Column for Course to be Reviewed!")
HSCrsNo = Columns(HSCrs & ":" & HSCrs).Column ' Course Col #
Set lls = Workbooks.Add
With lls
.Title = "Valdez High School"
.Subject = "Sophomores"
End With
' Selection.AutoFilter Field:=12, Criteria1:="5-A"
Set wsl = ActiveSheet
wks.Columns(FSJS).Copy wsl.Columns(1)
wks.Columns(249).Copy wsl.Columns(2)
wks.Columns(251).Copy wsl.Columns(3)
wks.Columns(252).Copy wsl.Columns(4)
wks.Columns(253).Copy wsl.Columns(5)
wks.Columns(254).Copy wsl.Columns(6)
wks.Columns(HSCrs).Copy wsl.Columns(7)
With wsl.Range("A:H").EntireColumn
.ColumnWidth = 255
.AutoFit
End With
wsl.SaveAs Filename:="C:\Valdez\Geography.xls",
FileFormat:=xlNormal
End Sub
Thanks a Bunch Guys
Nancy X.