+ Reply to Thread
Results 1 to 6 of 6

Copy Filter Data and paste it on another workbook with special cells(Only Visible Cells)

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Post Copy Filter Data and paste it on another workbook with special cells(Only Visible Cells)

    hello
    i using code to filter my 4 sheets Greater then 0(zero)
    Please Login or Register  to view this content.
    after apply above filter now i need to copy multiple rows and paste on another specific workbook
    for paste i m using below code
    for 1st sheet with the name ("V2"
    Please Login or Register  to view this content.
    for 2nd sheet with the name("LV")
    Please Login or Register  to view this content.
    For 3rd sheet with the name ("F2")
    Please Login or Register  to view this content.
    and 4th sheet with the name("L2")
    Please Login or Register  to view this content.
    if i play above code one by one all is going very well,,,,,,or
    if use in this way all is going very well
    Please Login or Register  to view this content.
    but here is a big problem..........if any sheet have no value greater then 0(zero)....then code paste all data... e.g shssts("LV") .Range("C5:C54").Copy but C5:C54 have no data greater then 0(zero) and it will paste on another sheet c5:c54 and again new sheets data will paste below the c54 while c5:c54 have no data
    so i want if any sheet have no data with range is greater then 0(Zero) then skip the copy paste code or use like SpecialCells(xlCellTypeVisible)
    plz help
    Last edited by HaroonSid; 04-12-2014 at 01:17 AM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Copy Filter Data and paste it on another workbook with special cells(Only Visible Cell

    Hi, haroon2015,

    when the Autofilter is applied check for the last visible cell in the column you applied the Autofilter to - the row number for this cell should be greater than the row number for the heading (meaning that data is available). If you compare that row number within an If-Statement the macro should only proceed with copying if the condition is met.

    Ciao,
    Holger
    Last edited by HaHoBe; 04-13-2014 at 07:03 AM.
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Copy Filter Data and paste it on another workbook with special cells(Only Visible Cell

    Hello HaHoBe
    thanx a lot for replying

    BTW
    i found the solution just right now by my friend

    here is solution :

    Please Login or Register  to view this content.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Copy Filter Data and paste it on another workbook with special cells(Only Visible Cell

    Hi, haroon2015,

    I´m no friend of using On Error Resume Next in order to prevent errors that may be caught with proper proramming - sooner or later you will run into trouble as that command just treats any wrong command as if it wasn´t given which may lead to unexpected or unwanted results.

    Ciao,
    Holger

  5. #5
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,080

    Re: Copy Filter Data and paste it on another workbook with special cells(Only Visible Cell


    then what to do HaHoBe

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Copy Filter Data and paste it on another workbook with special cells(Only Visible Cell

    Hi, haroo2015,

    use proper or adequate programming, fully qualified names of workbooks and worksheets.

    Please Login or Register  to view this content.
    Ciao,
    Holger

+ 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. Replies: 0
    Last Post: 03-20-2014, 11:51 AM
  2. VBA script problem - Copy and Paste Special data from one sheet to another.
    By akarev in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2013, 12:19 PM
  3. Copy and Paste Special in filter mode excel 2010?
    By tantcu in forum Excel General
    Replies: 6
    Last Post: 01-23-2013, 05:52 AM
  4. How to filter/copy/paste text between special characters?
    By martinek in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-14-2012, 03:04 PM
  5. Macro to copy and paste special values for column data and filter column data
    By ascottbag in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-10-2012, 02:15 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