LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 11
Default filtering and macros

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("D212500")
Range("D212500").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
Filtering with a macro gerry405 New Users to Excel 0 October 7th 05 11:05 AM
problems with macros cjjoo Excel Worksheet Functions 3 September 8th 05 10:00 AM
display count/results of filtering Excel in status bar JayDax Excel Discussion (Misc queries) 2 July 21st 05 11:41 PM
Filtering out Data Jo Davis Excel Discussion (Misc queries) 1 July 7th 05 11:34 AM


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