+ Reply to Thread
Results 1 to 7 of 7

trouble with autofilter

  1. #1
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    trouble with autofilter

    dear all,
    here below part of my code that should filter data based on textbox1.value inside a userform.
    this code is a part of macro that create a pdf file .
    strange things is that every time i run the macro the first time the pdf file is blank..if i run the macro a second time than all filtered data appears

    can someone help to understand why ?and what is wrong ?

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: trouble with autofilter

    You have not supplied the code that PDF's just the code that autofilters

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    Re: trouble with autofilter

    dear dave sorry,this is the code to generate pdf
    with ActiveSheet
    .ExportAsFixedFormat _
    Type:=xlTypePDF, _
    Filename:=FileFullPath, _
    Quality:=xlQualityStandard, _
    IncludeDocProperties:=True, _
    IgnorePrintAreas:=False, _
    OpenAfterpublish:=false
    end with

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: trouble with autofilter

    Attaching a sample workbook enables others to work on your problem:

    To attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include BEFORE/AFTER sheets if needed to show the process you're trying to complete or automate. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    To add a file to a new post

    To add a file to an existing post.

  5. #5
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    Re: trouble with autofilter

    hi dave ,

    here attchd my file.

    just insert in the sheet some data at your discreption then
    click on the logo and the user form wll pop up . then enter in the
    textbox the value that you want to filter (column N ) .
    you wll se that most of the time when you enter something new and then run the macro the pdf
    (create to be sent by email) is empty . but if you then run agai the macro everithing show up in the pdf .

    ..in the meantime tks for your help
    Attached Files Attached Files

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: trouble with autofilter

    I was getting that as well and the PDF part was freezing my excel.,When I looked through the code, your file location was not correct.

    "F:\BOOKING "
    I changed it to
    "F:\BOOKING\"
    and the problem went away.

    I assume when the code was in error, it was not finishing, and the sheet was not resetting.

  7. #7
    Forum Contributor
    Join Date
    02-14-2015
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    110

    Re: trouble with autofilter

    hi Dave ...tks so much .....just for your info in the meantime i solved the problem setting the print area before creating the pdf using the below code.....as per your suggestion i focused the problem to the pdf setting and not to the filters....I tried right now to change as per your suggestion but i get an error..if i put the second slash.......anyway tks so much for your help

    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)

Similar Threads

  1. Trouble hiding autofilter arrows
    By SHUTTEHFACE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-30-2014, 08:26 PM
  2. [SOLVED] Trouble with Autofilter-- novice user needs help please!
    By g0g0 in forum Excel General
    Replies: 3
    Last Post: 07-17-2014, 12:48 PM
  3. Trouble copying autofilter data to listbox based on combobox values
    By Blackbeginnings in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-26-2013, 10:48 AM
  4. Trouble with Find versus an Autofilter
    By SueWithQuestion in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-27-2011, 08:27 AM
  5. Trouble w/ Autofilter Excel 2003 protected wks
    By rgarber1950 in forum Excel General
    Replies: 7
    Last Post: 01-10-2009, 04:43 AM
  6. Trouble with AutoFilter
    By amisrahi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-07-2008, 06:07 PM
  7. Capturing the Excel AutoFilter Sorting Event-sort and autofilter options
    By Kognyto in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-11-2008, 05:36 PM

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