Results 1 to 4 of 4

Delete Visible cells error

Threaded View

  1. #1
    Registered User
    Join Date
    06-01-2014
    Posts
    79

    Delete Visible cells error

    I have this macro that filters information, copies it, and pastes it into the next sheet. The copy and paste works great but when it tries to delete the visible cells I get an error in the highlighted line

    Sub cutRehab(): Dim w1 As Worksheet, w2 As Worksheet
    Set w1 = Sheets("Nursing"): Set w2 = Sheets("Rehab+Therapy")
    w1.Range("A2").CurrentRegion.AutoFilter field:=30, Criteria1:="Rehab"
    w1.UsedRange.Offset(2).SpecialCells(xlCellTypeVisible).Copy w2.Range("A3")
    Application.DisplayAlerts = False
    w1.UsedRange.Offset(2).SpecialCells(xlCellTypeVisible).Delete
    Application.DisplayAlerts = True
    w1.AutoFilterMode = False
    End Sub
    Any help is greatly appreciated. Thank you!
    Last edited by jmcconville18; 08-12-2016 at 05:13 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy Visible cells and paste values only to visible target cells
    By wotadude in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-20-2024, 12:01 AM
  2. Visible Cells Only - Greyed out "Delete Rows"
    By Kashus in forum Excel General
    Replies: 4
    Last Post: 04-04-2017, 11:22 PM
  3. [SOLVED] Delete only visible cells from a large amount of data
    By krazyhype19 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-11-2014, 06:07 AM
  4. [SOLVED] Copy/Pasting Values from visible cells (using autofilter) to visible cells
    By evakotsi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2012, 07:49 AM
  5. Copy only Visible cells to another sheet in Macro? Runtime 438 error?
    By nbaj2k in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-18-2006, 11:30 AM
  6. delete contents of visible cells only
    By michael.beckinsale in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-05-2006, 04:35 AM
  7. [SOLVED] Help finding error setting range to Visible Cells
    By Ed in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-26-2005, 03: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