+ Reply to Thread
Results 1 to 7 of 7

Macro (Delete Entire row Cell in column R is empty)

  1. #1
    Registered User
    Join Date
    12-20-2011
    Location
    Boksburg, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Macro (Delete Entire row Cell in column R is empty)

    Can someone please help me with code in VB (Marco) to delete entire row when cell in column R is empty

    Please look at example

    Capture.jpg

    Andrew
    Last edited by andrewvt; 12-20-2011 at 06:29 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Macro (Delete Entire row Cell in column R is empty)

    Any reason why you have highlighted cells in column AR in yellow?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Macro (Delete Entire row Cell in column R is empty)

    You could do a For Loop. You could write it so it says:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-20-2011
    Location
    Boksburg, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro (Delete Entire row Cell in column R is empty)

    Conditional formatting makes it yellow. No other reason

  5. #5
    Registered User
    Join Date
    12-20-2011
    Location
    Boksburg, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro (Delete Entire row Cell in column R is empty)

    Code doesn't work. I'm new to VB so please help

  6. #6
    Valued Forum Contributor
    Join Date
    01-10-2011
    Location
    swindon, england
    MS-Off Ver
    Excel 2010
    Posts
    317

    Re: Macro (Delete Entire row Cell in column R is empty)

    Sorry that was example Try

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-20-2011
    Location
    Boksburg, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Macro (Delete Entire row Cell in column R is empty)

    Hi Jeskit

    It worked but I have to run it a couple of times before it completely remove all lines

    I have it as follows

    Sub Delete_Row()

    Dim cell As Range

    For Each cell In Range("Quotation!R21:Quotation!R105")
    If cell.Value = " " Then 'if you want this to look for cell which have no values at all put if cell.value = ""
    cell.EntireRow.Delete
    End If
    Next cell

    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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