LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default VB Application for Advanced filter Macro

Hi all,
I really need your advice please!!

I'm trying to build an application that's main purpose is to perform
several Advanced Filter actions on an Excel sheet.
the idea is to open an xls file of report, and to split the data to
new sheets within the same workbook, by automating this simple
operation.

i recorded a macro which works perfect on specific spreadsheet, but
doesn't work as part of my application, to enable working with any
other spreadsheet.

Since my problem is (mainly) in the function Advanced Filter, can u
please tell me what's wrong with this code??
' open the file in excel
Dim xlApp As Object
Set xlApp = CreateObject("excel.application")
xlApp.Visible = True
xlApp.Workbooks.Open ("C:\Projects\myreport.xls")
' add new sheet
xlApp.Sheets.Add
xlApp.Sheets("Sheet1").Select
xlApp.Sheets("Sheet1").Name = "mySheet"
' perform advanced filter on the original worksheet (now it's
number 2)
xlApp.Worksheets(2).Range("A1").CurrentRegion.Adva ncedFilter _
Action:=xlFilterCopy,
CriteriaRange:=xlApp.Worksheets(2).Range("K1:K2"),
CopyToRange:=xlApp.Worksheets(2).Range("A500")



if there's any other way to perform it, please reply...

almost desperate....
Poogy
 
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
Advanced Filter Macro Failing Mustang Excel Discussion (Misc queries) 3 June 18th 09 05:15 AM
Advanced Filter Macro Alex.W Excel Discussion (Misc queries) 1 April 4th 08 12:19 PM
Advanced Filter Macro Dolphinv4 Excel Discussion (Misc queries) 2 March 20th 08 11:42 AM
Why won't advanced filter return filter results? jaws4518 Excel Worksheet Functions 5 September 12th 06 06:11 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Excel Worksheet Functions 1 May 12th 05 02:06 AM


All times are GMT +1. The time now is 01:32 PM.

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

About Us

"It's about Microsoft Excel"