Closed Thread
Results 1 to 2 of 2

Need help on Macro programming

  1. #1
    Registered User
    Join Date
    08-28-2011
    Location
    Vancouver
    MS-Off Ver
    Excel 2007
    Posts
    5

    Need help on Macro programming

    Hello everyone,

    I am relatively new to Macro, so rather from writing it, I use Macro recording.

    Below are my copied code:


    Selection.AutoFilter
    Columns("L:O").AdvancedFilter Action:=xlFilterCopy, CriteriaRange:=Range("U1:U2"),
    CopyToRange:=Range("V1"), Unique:=False

    Columns("W:W").Select
    Selection.AutoFilter
    Range("W1:W99436").AdvancedFilter Action:=xlFilterCopy, CopyToRange:=Range( _
    "AA1"), Unique:=True



    After pressing the hot key, the first Autofilter works. It is based on L M N O columns and gereate 4 new columns, V W X Y.

    2nd filter will based on column w and generate into a new column, AA.

    However, at AA column, it only generates header (the column title) but no data. When I do it manually, there are header as well as filtered data.

    Does anyone catch any mistake in the code? I tried many times but it only generate the header of Column w.

    If you can offer me a hand, that would be perfect.

    Thanks so much,

    Mucc

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

    Re: Need help on Macro programming

    Welcome to the Forum. You need to read the Forum Rules, you've broken two with your first post

    Your post does not comply with Rule 3 of our Forum RULES. 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 # at the top of your post window. For more information about these and other tags, found here

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    PLEASE PM WHEN YOU HAVE DONE THIS AND I WILL DELETE THIS POST
    Hope that helps.

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

    Free DataBaseForm example

Closed Thread

Thread Information

Users Browsing this Thread

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

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