+ Reply to Thread
Results 1 to 11 of 11

Delete specific number of rows for each column with user input

  1. #1
    Registered User
    Join Date
    12-11-2018
    Location
    Detroit
    MS-Off Ver
    2010
    Posts
    43

    Delete specific number of rows for each column with user input

    I tried putting user input for deleting number of rows. But I'm not getting idea how to delete it for particular column. Please help

    Please Login or Register  to view this content.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: I need to delete specific number of rows for each column with user input

    .
    You will need to clarify your goal.

    It appears you are searching for a specific term, then want to delete the entire row the term is located on ?

  3. #3
    Registered User
    Join Date
    12-11-2018
    Location
    Detroit
    MS-Off Ver
    2010
    Posts
    43

    Re: I need to delete specific number of rows for each column with user input

    I want to find a column using header name. Then in that column I need to delete specific number of rows. that specific number of rows changes according to the measurements we take here. It can be first rows or seven rows in that particular column. When i run the above macro, it deletes rows in all the column. I want to delete rows in that particular column, it finds.

  4. #4
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Delete specific number of rows for each column with user input

    .
    A little clearer ...

    When you select the column ... are you then wanting to search for a particular term in that column ? Then you are wanting to delete a specific number of rows below that term / including the row
    the term is on ?


    Or ....


    Are you wanting to select a column ... then select a row number (not search for a term) ... then specify how many rows to delete ?


    Sorry for the questions. You can see there what it is you wanting .... all we have is your description to understand.
    Oftentimes it helps to provide a mock up of your worksheet with a "before" and "after" view of what is expected.

    Thanks

  5. #5
    Registered User
    Join Date
    12-11-2018
    Location
    Detroit
    MS-Off Ver
    2010
    Posts
    43

    Re: Delete specific number of rows for each column with user input

    Sorry for not making it clear for you. The below macro is what I wrote in first place. It was giving some error, so idk what to do.

    1. Find the column using header name
    2. define number of rows needs to be deleted in that column, I don't want to search any term. Just want to delete number of rows from the row where the values start from.
    3. While deleting it should delete and shift xlUp only in that column, widout deleting other columns.



    Please Login or Register  to view this content.

  6. #6
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Delete specific number of rows for each column with user input

    .
    See if this does what you are seeking ...

    Please Login or Register  to view this content.

    Example workbook attached ...
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    12-11-2018
    Location
    Detroit
    MS-Off Ver
    2010
    Posts
    43

    Re: Delete specific number of rows for each column with user input

    No , I'm looking for different one. I have attached a macro. Run through steps you will understand. I have mapped start and end point, but could not delete it. the end row is where i need to tell , how much rows that needs to be deleted. If u put 5, it goes to 5th row and map as end address, but could not delete it.
    Attached Files Attached Files

  8. #8
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Delete specific number of rows for each column with user input

    .
    This ?

    Please Login or Register  to view this content.

  9. #9
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Delete specific number of rows for each column with user input

    .
    Slightly edited version. Eliminates one SELECT statement.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    12-11-2018
    Location
    Detroit
    MS-Off Ver
    2010
    Posts
    43

    Re: Delete specific number of rows for each column with user input

    Thanks for your reply. I used your code for another purpose ( which i needed right on time). But i made what I needed.

    Please Login or Register  to view this content.
    Thank you for your support.

  11. #11
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Delete specific number of rows for each column with user input

    .
    You are welcome.

+ 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] Delete rows based on two specific dates using a input box
    By sloshpuppy in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-16-2018, 06:57 AM
  2. [SOLVED] Delete specific range cell data based on user input
    By terriertrip in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-06-2017, 07:57 PM
  3. [SOLVED] Delete specific data from (x) new rows added as defined by user through input box
    By Jaysk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-10-2017, 12:41 AM
  4. [SOLVED] Help required - User input for text search and delete remaining rows
    By ssss2005 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-20-2015, 11:06 AM
  5. Using text box input to lookup number and replace based on user input into new column
    By harl3y412 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2011, 03:15 PM
  6. Replies: 1
    Last Post: 10-16-2010, 02:43 PM
  7. Delete rows based on user input
    By Militia in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-10-2009, 06:33 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