Syntax Problem

L

Len

Hi Group;
Do not work with Excel very much, so I am unfamiliar with
formating of instructions.

A university wants a list of the students in our school that
have over a certain Test Score.

The Scores are in Column 15. We enter the minimum score they
desire.

I get a syntax error on the line indicated as such.

ColNum = 15
TstScr = InputBox("Enter the Minimum Test Score You Want to Send
Letters to:!")

Set lbls = Workbooks.Add(1)
Set wslb = lbls.Worksheets(1)
lbls.Title = "Letters to Universities"
lbls.Subject = "InterNational"

With wkst
If .AutoFilterMode Then .AutoFilterMode = False
Set rng = .Range("A1").CurrentRegion
With rng
.AutoFilter Field:=ColNum, Criteria1:>"TstScr" '
Error on this line!
.Columns(ColNum).Copy wslb.Columns(1).Cells(1)
.Columns(12).Copy wslb.Columns(2).Cells(1)
.Columns(25).Copy wslb.Columns(3).Cells(1)
.Columns(37).Copy wslb.Columns(4).Cells(1)
.Columns(48).Copy wslb.Columns(5).Cells(1)
.Columns(69).Copy wslb.Columns(6).Cells(1)
End With
End With

Can someone give me the proper syntax, I just cannot figure it out.

Thanks in Advance

Len
 
D

Don Guillett

try
==========
Criteria1:=">=" & tstscr
=============
AutoFilter Field:=1, Criteria1:=">=5"
 
L

Len

Don;
Thanks for getting back to me!

I still get a syntax error on

Criteria1:=">=" & tstscr

You can see where I placed the code below!

Len

Don Guillett said:
try
==========
Criteria1:=">=" & tstscr
=============
AutoFilter Field:=1, Criteria1:=">=5"
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
(e-mail address removed)

Criteria1:=">=" & tstScr
 
T

Tom Ogilvy

..AutoFilter Field:=ColNum, Criteria1:= ">=" & TstScr

is where you should have placed it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top