+ Reply to Thread
Results 1 to 6 of 6

For loop in macro

  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

    Please Login or Register  to view this content.
    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

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: For loop in macro

    Please wrap your code in code tags, before the moderators get you...

    Forum rules
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # button at the top of the post window. If you are editing an existing post, press Go Advanced to see the # button.

    Cheers

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: For loop in macro

    Why do you want the Loop? What are you filtering for?

    Currently your code wil filter for 1,2,3,4,5 & finish displaying 5
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

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

    Re: For loop in macro

    This is what i meant to do

    in the file, i want to get the latest data only as shown at the side
    i plan to use filter and get the latest data
    what if i have more than 6 data let say 100 or 200
    i wish to have a macro on this

    thanks in advance
    Attached Files Attached Files

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: For loop in macro

    What determines "latest data"?

    I don't think AutoFilter will do this?

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: For loop in macro

    This might be what you want
    Please Login or Register  to view this content.

+ Reply to Thread

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