Thread: Syntax Problem
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
len len is offline
external usenet poster
 
Posts: 53
Default Syntax Problem

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" wrote:

try
==========
Criteria1:="=" & tstscr
=============
AutoFilter Field:=1, Criteria1:="=5"
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Len" wrote in message
...
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"


Criteria1:="=" & tstScr


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