+ Reply to Thread
Results 1 to 7 of 7

vba with autofilter which work not if the specification is not included

  1. #1
    Registered User
    Join Date
    08-27-2015
    Location
    Friedberg
    MS-Off Ver
    2010
    Posts
    68

    vba with autofilter which work not if the specification is not included

    Hi all,

    I have the Problem that if the word "stop" is not in the table in column J, the VBA copy all data from the table.
    In this case it should copy nothing.


    Please Login or Register  to view this content.

    Kind regards,

    Thorsten

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: vba with autofilter which work not if the specification is not included

    Hi,

    Why are you filtering from row 1 and only copying from row 4?
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    08-27-2015
    Location
    Friedberg
    MS-Off Ver
    2010
    Posts
    68

    Re: vba with autofilter which work not if the specification is not included

    I have a table with 6 different keywords in column J (restart, stop, enrolment, Change, cancellation and leaver)
    For this I have 6 VBA-Codes to look for the keyword in column "J" (stop in my example) and copy the Ids in column "D" to another worksheet starting in N4.

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: vba with autofilter which work not if the specification is not included

    That does not explain why you filter using row 1 as the header but copy starting at row 4?

  5. #5
    Registered User
    Join Date
    08-27-2015
    Location
    Friedberg
    MS-Off Ver
    2010
    Posts
    68

    Re: vba with autofilter which work not if the specification is not included

    oh, you are right. I will change the Range from D4:D500 to D2:D500 and try again

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: vba with autofilter which work not if the specification is not included

    Changing the range will not fix the problem but I wanted to be sure if there was a reason for it before suggesting a solution. Perhaps this will work for you
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    08-27-2015
    Location
    Friedberg
    MS-Off Ver
    2010
    Posts
    68

    Re: vba with autofilter which work not if the specification is not included

    It works. Many thanks.

+ 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] Using AutoFilter Criteria1 for list of NOT included
    By fpperryaz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-29-2016, 06:59 PM
  2. CountIF in Autofilter does not work.
    By Faridwahidi in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-25-2014, 02:41 AM
  3. [SOLVED] Formula does not work if cell reference is not included
    By yreddic in forum Excel General
    Replies: 3
    Last Post: 08-01-2012, 05:46 PM
  4. Excel 2007 : Will autofilter work?
    By cliffshow in forum Excel General
    Replies: 1
    Last Post: 08-20-2011, 03:42 PM
  5. Autofilter Does not work
    By jhc8255 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-22-2011, 09:34 AM
  6. [SOLVED] Why won't it work when I use VBA to set autofilter criteria to ce.
    By biggy in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2005, 11:06 AM
  7. [SOLVED] Autofilter(Top 10...): What does it do? How does it work?
    By Chet Hurd in forum Excel General
    Replies: 3
    Last Post: 05-10-2005, 04:06 PM

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