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

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.
 
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 03:14 PM.

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"