View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
tonyhabayeb tonyhabayeb is offline
external usenet poster
 
Posts: 5
Default How do I build an excel query? (something like SQL)

Hello,
I founf the solution.
I can use the "advanced filerring" function.
Here is the code that I used:
Sheets("Data").Cells.AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:= Sheets("Temp").Range("A1:B3"),
CopyToRange:=Range("A5"), Unique:=False


Information:
"Data" -- The data sheet that includes the table
"Temp" -- the destination sheet for the answer
"A1:B3" -- Contains the conditions of the filterring
"A5" -- the first cell to copy the data

Thanks for all the people who tried to help me :)