View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ardus Petus Ardus Petus is offline
external usenet poster
 
Posts: 718
Default Data Type Problem!!!

Selection.AutoFilter Field:=6, Criteria1:= format(xsect,"00") & ":" &
format(ysect,"00")

If field #6 holds a time value (01:30 = 1 minute 30 secs), that won't work
either.

Cheers,
--
AP

"Addy" a écrit dans le message de news:
...
I am having trouble with a data type ...that is what I suspect.

I am trying to make a macro with a loop for running a Autofilter where in
the macro selects the filtes as 1:01,1:02,1:03....1:40.

I am able to make a loop and run it properly but the problem is that macro
does not work for values 1:01,1:02...1:09 after that it works fine. The
command I am using is:

Dim xsect As Integer
Dim ysect As Integer
.
.(This area has the loop which is working fine)
.
Selection.AutoFilter Field:=6, Criteria1:=xsect & ":" & ysect

Now the problem is the macro runs a search for 1:1 and not 1:01 is there
any
way I can make ysect increase by 1 and show i t up as 2 digits for a
single
digit as well. If not then what should I do?