LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 11
Default Filtering with a macro

Hi everyone,

I am new to excel and I need help with creation of a macro or macro's

I have a few problems, the first of them is that my spreadsheet gets its data from an external source (set to automatically refresh on open), I had managed to create a macro that populates my vlookups columns, that seems to run fine as long as it doesn't go over certain amount of lines(12,500), What I would really like is for it to just populate down to the bottom of the data (which varies from day to day) is there a command such as autofill, at the moment the macro remembers how many lines I populated when I was recording it even though I double click (which in essence is same as double click-autofill), which is not what I was tring to do..

code below:
Sub sort1()
'
' sort1 Macro
' Macro recorded 08/09/2005 by SGUHT
'

'
Range("D2").Select
Selection.AutoFill Destination:=Range("D2:D12500")
Range("D2:D12500").Select
Range("F2").Select
Selection.AutoFill Destination:=Range("F2:F12500")
Range("F2:F12500").Select
Range("L2").Select
Selection.AutoFill Destination:=Range("L2:L12500")
Range("L2:L12500").Select
Range("A2:X2").Select
Range("X2").Activate
Range(Selection, Selection.End(xlDown)).Select
Range("A2:X12500").Select
Range("X2").Activate
Selection.sort Key1:=Range("U2"), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("Y2:Z2").Select
Selection.AutoFill Destination:=Range("Y2:Z12500")
Range("Y2:Z12500").Select
End Sub

The other thing is, I do filering on the data after its refreshed with the new data, but I am having trouble with doing a more than one filter

ie multiple xlOr's :

code below

Sub ASC_0_3_9()

Range("A1").AutoFilter Field:=15, Criteria1:="3", Operator:=xlOr, _
Criteria2:="5", Operator:=xlOr, _ Criteria3:="9"

End Sub

also, is there any way of putting lots of macros together, as I filter on lots of criteria and although I have created macro's for each filtering process, it's still a hassle to run these one by one,

...So basically, I am looking to be able to state in the code

If for example col2=F333 and col5=Gastro and col23 contains Joe blogs
then display found,
also
if col5=Gerry and col7=Tony
then also display found as well
 
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
Combo Box Filtering Macro Jon Excel Discussion (Misc queries) 0 March 23rd 05 07:03 PM
Combo Box Filtering Macro Jon Excel Discussion (Misc queries) 0 March 23rd 05 06:59 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM
Filtering and replacing values through a macro vic Excel Worksheet Functions 1 January 27th 05 09:53 PM


All times are GMT +1. The time now is 07:18 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"