Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Do Until syntax problem | Excel Programming | |||
Help Please: Syntax Problem | Excel Programming | |||
syntax problem | Excel Programming | |||
Syntax problem | Excel Programming | |||
Another Syntax Problem | Excel Programming |