Results 1 to 3 of 3

Macro to Delete blank rows by shifting rows upwards

Threaded View

  1. #1
    Forum Contributor
    Join Date
    07-12-2018
    Location
    South Africa
    MS-Off Ver
    Office 2021
    Posts
    2,765

    Macro to Delete blank rows by shifting rows upwards

    I have data on sheet "SH"


    Where there are blank rows between the data, I would like these shifted upwards just below the last row containing data


    I have tried to write code to do this, but nothing happens when running the code


     Sub DeleteBlankCells_CP()
    With Sheets("CP")
    On Error Resume Next
    
    .Range("A2:A & rows.count").SpecialCells(xlCellTypeBlanks).Areas(1).Delete Shift:=xlUp
     End With
    
    
    End Sub

    Kindly test & amend my code
    Last edited by Howardc1001; 12-22-2022 at 04:26 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. move data upwards to a blank row and delete all blank rows below
    By RIZVI in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-29-2019, 09:31 AM
  2. Replies: 1
    Last Post: 02-23-2015, 09:42 PM
  3. Macro to delete blank rows if column I is blank for the row
    By tiger10012 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-10-2013, 03:01 PM
  4. [SOLVED] Delete blank rows between data rows, shift rows up, then repeat
    By excelactuary in forum Excel General
    Replies: 2
    Last Post: 03-11-2013, 11:53 AM
  5. [SOLVED] How to Delete Multiple Consecutive Blank Rows - Delete all Blank Rows
    By raw_geek in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-16-2012, 03:17 PM
  6. Eliminate blank rows by shifting rows up
    By jman0707 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 11-06-2008, 02:10 AM
  7. Using a macro to delete all blank rows
    By Shirley Munro in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-18-2005, 04:05 AM

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