+ Reply to Thread
Results 1 to 2 of 2

Deleting a partial row

  1. #1
    Registered User
    Join Date
    01-06-2017
    Location
    san diego, CA, USA
    MS-Off Ver
    2013
    Posts
    1

    Deleting a partial row

    I have a worksheet that I update every week with aging tasks. I pull data from another worksheet to determine which tasks are within my team and the others I delete. I have columns on either side of the fields that I would like to keep as there are formulas that produce results based on the data on the inside columns. I have a script that will delete the entire row if the task is not associated with my team, but I would prefer to just delete a partial row say from column "B" to column "I". Below is my code, how can I alter it to perform the way I want?

    Sub test()
    Dim LR As Long, i As Long
    With Sheets("Data (QM12)")
    LR = .Range("C" & Rows.Count).End(xlUp).Row
    For i = LR To 1 Step -1
    If IsError(Application.Match(.Range("C" & i).Value, Sheets("Conditions (QM16)").Columns("A"), 0)) Then .Rows(i).Delete
    Next i
    End With
    End Sub


    Thank you in advance for any assistance

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,910

    Re: Deleting a partial row

    Take a look at Excel Tables. They do exactly what you are trying to do. Also, you might be able to get rid of those formulas off to the side. I there is a formula in a cell, the table "remembers" it meaning that even if you delete all the rows in the table, when you add data back in, the formula returns and is automatically duplicated for how may rows you have.

    Here is more information on tables: http://www.utteraccess.com/wiki/inde...ables_in_Excel

    Also a copy of the workbook would go a long way to helping us with your project.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

    Here is a piece of code that clears the data in a table. To call it in code use ClearTable SheetName, TableName.
    Please Login or Register  to view this content.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

+ 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. Deleting partial row if certain value exists
    By Emily616524 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-05-2015, 10:10 AM
  2. [SOLVED] deleting partial row
    By jaunfra in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-02-2013, 03:22 PM
  3. Deleting Partial Content in a Column
    By luu980 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 03-09-2009, 03:58 PM
  4. deleting partial data in column
    By joelw in forum Excel General
    Replies: 4
    Last Post: 10-07-2008, 12:05 PM
  5. Deleting rows based upon partial cell text
    By mjwillyone in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-17-2008, 10:29 PM
  6. [SOLVED] Opening and deleting File with only partial Filename
    By sean_f in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2006, 11:35 PM
  7. Deleting cell contents based on partial content?
    By Jordon in forum Excel General
    Replies: 4
    Last Post: 03-18-2005, 08:06 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