+ Reply to Thread
Results 1 to 12 of 12

Something wrong with the Marco

  1. #1
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    520

    Something wrong with the Marco

    Dear all

    I tried to make a Dynamic range, and it does not work on the code, i wonder what's wrong
    Can anyone be kind enough to help

    Thanks in advance

    Sub FilterMe8()
    '
    ' FilterMe8 Macro
    '

    Application.CutCopyMode = False
    Application.CutCopyMode = False
    Sheet2.Range("A5").CurrentRegion.AdvancedFilter Action:=xlFilterCopy,
    CriteriaRange:=sheet1.Range("F2:H3"), CopyToRange:=Sheet1.Range("A7:C7"), Unique:=False[/COLOR]
    End Sub

    My data starts at Sheet2 (data) "A5". and i want the it as a dynamic range

    Thanks
    Eric
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Something wrong with the Marco

    Try remove 2 from Add2
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Something wrong with the Marco

    Hello Tsang
    Posts 188 for you and still you don't know how to post code ...!
    See for code tags
    PCI
    - Battle without fear gives no glory - Just try

  4. #4
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: Something wrong with the Marco

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    520

    Re: Something wrong with the Marco

    Sorry

    i do not understand
    Eric

  6. #6
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    520

    Re: Something wrong with the Marco

    Sory

    I do not understanding

    Eric

  7. #7
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,937

    Re: Something wrong with the Marco

    And that after 190 posts?
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Something wrong with the Marco

    Your post does not comply with Rule 2 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Click on Edit to open your thread, then highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    If posting code please use code tags, see here.

  9. #9
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: Something wrong with the Marco

    Eric,
    Please see the red unberline.
    Just it back then.
    HTH
    ikboy

  10. #10
    Forum Contributor
    Join Date
    12-06-2015
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    520

    Re: Something wrong with the Marco

    You mean

    [code]'
    ' FilterMe8 Macro
    '

    '
    Application.CutCopyMode = False
    Application.CutCopyMode = False
    Sheet2.Range("A5").CurrentRegion.AdvancedFilter Action:=xlFilterCopy, _
    CriteriaRange:=Sheet1.Range("F2:H3"), CopyToRange:=Sheet1.Range("A7:C7"), Unique:=False
    End Sub [code]

  11. #11
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,088

    Re: Something wrong with the Marco

    The last one must be [/code], see Norie's thread

  12. #12
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: Something wrong with the Marco

    Eric,
    Copy my code to replace yours, try and compare what difference.
    By the way use the # in the tools bar to quote your code if post.
    ikboy

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Macro exporting and saving the wrong page with wrong name
    By taylorsm in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-08-2018, 01:24 PM
  2. What is wrong with this Marco
    By tfilipe in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-25-2018, 08:06 PM
  3. [SOLVED] Wrong formula or wrong function?
    By cpope in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-08-2017, 10:27 AM
  4. How to create a Marco to run same Marco run on everysheet.
    By chriskingkiller in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-09-2013, 02:53 AM
  5. Wrong coding or RANDBETWEEN is wrong?
    By zbor in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 07-31-2013, 10:01 AM
  6. Autofilter in marco on wrong field
    By nzkazza in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-21-2012, 01:31 AM
  7. Run marco of a source file in the source file via marco of a master patch file
    By freeman6479 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2012, 10:55 AM

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