+ Reply to Thread
Results 1 to 8 of 8

Cut & Paste - AutoFilter SpecialCells(xlCellTypeVisible)

  1. #1
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2013, 2019 & O365
    Posts
    214

    Talking Cut & Paste - AutoFilter SpecialCells(xlCellTypeVisible)

    Hi All,

    Can you please correct below codes and provide me a right approach for AutoFilter SpecialCells(xlCellTypeVisible)??

    Problem: - The below codes are just working fine for me when the auto-filtered data is copied and pasted to a new worksheet, but I want to use the 'Cut and Paste' methodology instead of that.

    Please Login or Register  to view this content.

    Here I have tried with below codes to get the output as per the above description and codes. Later, in the last....This deletes the copied cells's entire row

    Please Login or Register  to view this content.

    ...but I know it is not a good way. Please help me out to get a smart way for applying CUT and PASTE methodology on the filtered data/ cells (AutoFilter.Range.SpecialCells(xlCellTypeVisible)).

    Please find the attached for better understanding:
    MS Excel Version: 2007

    Thanks in Advance!
    Last edited by SunOffice; 06-19-2011 at 05:29 PM.
    Excelforum is Completely Awesome! True learning with Live Examples & Best Techniques!!

  2. #2
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Cut & Paste - AutoFilter SpecialCells(xlCellTypeVisible)

    Hi,


    Here is a portion of your code to "Copy Paste". Not sure why you want to do this but....

    Please Login or Register  to view this content.
    Charles

    There are other ways to do this, this is but 1 !
    Be Sure you thank those who helped.
    IF YOU'RE SATISFIED BY ANY MEMBERS RESPONSE TO YOUR ISSUE PLEASE USE THE STAR ICON AT THE BOTTOM LEFT OF THE POST UNDER THEIR NAME.

  3. #3
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2013, 2019 & O365
    Posts
    214

    Re: Cut & Paste - AutoFilter SpecialCells(xlCellTypeVisible)

    Thanks for ur quick reply!

    ...here I'm getting a Run-time error '438': Object doesn't support this property or method, please see below of that section.

    Range("A1").Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
    False, Transpose:=False
    Actually I have a huge data in the main worksheet, which is maintained on a daily basis. I have to cut the values on the tomorrow's date and paste in a new worksheet and keep that data.

    In my codes... I get the data in a new worksheet 'GetDATA', but it was copied, so doesn't delete copied values from the main worksheet, which is now a big problem for me.
    Last edited by SunOffice; 06-07-2011 at 09:32 PM.

  4. #4
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Cut & Paste - AutoFilter SpecialCells(xlCellTypeVisible)

    Hi,


    If I understand you this will now copy and delete the data.

  5. #5
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2013, 2019 & O365
    Posts
    214

    Re: Cut & Paste - AutoFilter SpecialCells(xlCellTypeVisible)

    Hi,

    Thanks for ur kind efforts!

    I just checked ur codes for deleting the SpecialCells(xlCellTypeVisible) of the autoFilter mode. It works fine in a better way than mine.

    Please Login or Register  to view this content.

    In your codes, under the below line:
    Range(Cells(VisRng.Offset(0, 0).Row, 1), Cells(Range("A65536").End(xlUp).Row, 8)).EntireRow.Delete
    I just changed from (VisRng.Offset(1, 0).Row, 1) to (VisRng.Offset(0, 0).Row, 1), so all is going well.


    ...but I don't know wht's going wrong with the Dim strName As String, When I put a future date in the inputbox; that doesn't accept the date of the current month. for example 6/10/2011, 6/15/2011, 6/30/2011, but goes okay with the next month's dates.
    Last edited by SunOffice; 06-19-2011 at 05:26 PM.

  6. #6
    Valued Forum Contributor Charles's Avatar
    Join Date
    02-10-2004
    Location
    Biloxi
    MS-Off Ver
    Windows 7, Excel 2003,2007 & Mac2011
    Posts
    845

    Re: Cut & Paste - AutoFilter SpecialCells(xlCellTypeVisible)

    HI,

    Not sure why it works for "Next" month, but I changed this line of code.
    Note ">=". I changed it too what you see.


    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2013, 2019 & O365
    Posts
    214

    Re: Cut & Paste - AutoFilter SpecialCells(xlCellTypeVisible)

    Hi,

    I re looked at the file you posted and changed the

    "If strName = vbNullString Or strName >= VBA.Date Then" back too

    "If strName = vbNullString Or strName <= VBA.Date Then"
    and it tested ok. I do not know why it failed before.

  8. #8
    Forum Contributor
    Join Date
    08-12-2010
    Location
    Excel World
    MS-Off Ver
    Excel 2013, 2019 & O365
    Posts
    214

    Re: Cut & Paste - AutoFilter SpecialCells(xlCellTypeVisible)

    Thank you Mr Charles for great help in a quick time!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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