Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
len len is offline
external usenet poster
 
Posts: 53
Default Syntax Problem

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
  #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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Syntax Problem

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

is where you should have placed it.

--
Regards,
Tom Ogilvy


"Len" wrote:

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



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

Tom;
Thanks, Great, it works fine now!

Hope you have a great day!

Len

"Tom Ogilvy" wrote:

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

is where you should have placed it.

--
Regards,
Tom Ogilvy


"Len" wrote:

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


Reply
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
Do Until syntax problem excelnut1954 Excel Programming 5 October 21st 06 12:50 AM
Help Please: Syntax Problem Oblivious Excel Programming 3 June 6th 06 03:00 PM
syntax problem dorre Excel Programming 3 March 20th 06 05:20 PM
Syntax problem unknowndevice[_4_] Excel Programming 4 August 26th 05 10:57 PM
Another Syntax Problem Sharlene England Excel Programming 2 December 2nd 03 10:04 PM


All times are GMT +1. The time now is 10:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"