Results 1 to 6 of 6

For loop in macro

Threaded View

  1. #1
    Registered User
    Join Date
    11-05-2010
    Location
    Penang, Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    4

    For loop in macro

    Dear all,

    May i know what's wrong with the code here

    Sub macro()
    
    Dim d As Integer
    For d = 1 to 5
    ActiveSheet.Range("$A$1:$B$20").AutoFilter Field:=1, Criteria1:=Array("d"), Operator:=xlFilterValues
    Next d
    
    End Sub
    I want to display a certain filtered value. Such as this eg, i want all the detail of 5 display. But I could not get any data except the header. Once I remove the "d" in array I can get the answer

    Thank you

    Regards,
    sorhaishadow
    Last edited by sorhaishadow; 11-07-2010 at 05:50 AM. Reason: edit code

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1