+ Reply to Thread
Results 1 to 6 of 6

vba help to find cell based and delete rows

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    26

    vba help to find cell based and delete rows

    i am trying to figure out how to write the vba to locate a cell based on its value and then delete that current row and all rows that fall above it.

  2. #2
    Forum Contributor
    Join Date
    10-19-2012
    Location
    chennai
    MS-Off Ver
    Excel 2013
    Posts
    134

    Re: vba help to find cell based and delete rows

    Hi

    try the below code


    Please Login or Register  to view this content.
    RoyalRajan

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: vba help to find cell based and delete rows

    Something like:
    Please Login or Register  to view this content.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  4. #4
    Registered User
    Join Date
    05-09-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: vba help to find cell based and delete rows

    its works great but only works every time if i select the cell that contains the value i am looking for first. is there a way to may it select the cell that contains what i am looking for before the rest runs.

    Quote Originally Posted by Olly View Post
    Something like:
    Please Login or Register  to view this content.

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: vba help to find cell based and delete rows

    Just change this line:
    Please Login or Register  to view this content.
    to whatever you need it to be. This determines which range is searched for your value. So if you want to look everywhere in the active sheet, you could use:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-09-2012
    Location
    Texas
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: vba help to find cell based and delete rows

    that worked great. thank you. cant believe i missed that line to set my range, but i guess that means i need to sleep after being up 2 days working on this crazy book.

    Quote Originally Posted by Olly View Post
    Just change this line:
    Please Login or Register  to view this content.
    to whatever you need it to be. This determines which range is searched for your value. So if you want to look everywhere in the active sheet, you could use:
    Please Login or Register  to view this content.

+ 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. [SOLVED] How to find and delete rows based on criteria within a given column
    By Student1990 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-10-2013, 02:35 PM
  2. [SOLVED] Find rows to delete with a macro based on cell content
    By mkraffert in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-28-2013, 06:27 PM
  3. Find and Delete rows based on criteria in multiple columns
    By Doctor_H in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2013, 08:03 PM
  4. Find rows and delete them based on multiple criteria
    By kostas in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-31-2012, 11:59 AM
  5. Replies: 2
    Last Post: 06-27-2006, 04:00 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