+ Reply to Thread
Results 1 to 7 of 7

Delete merged rows

  1. #1
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    244

    Delete merged rows

    Hi,
    I am stuch with this problem,What I want is a VBA code against the button "Delete" in the sheet "Metal" that,
    if in the sheet "Face" the value in the column AL is 0 then the entire row will be deleted in the "Metal" sheet.
    The values in Column J in "Face" and Column F in the sheet "Metal" is unique.That is Test1,Test2,Test3 etc..
    I am uploading a dummy sheet for reference.
    Thanks in advance.
    Attached Files Attached Files
    Last edited by fatalcore; 02-14-2012 at 05:41 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: Delete merged rows

    So should the values in column J in "Face" and column F in "Metal" be matched and then the value in column AL checked and then the corresponding row in Sheet Metal to be deleted?
    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
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    244

    Re: Delete merged rows

    Hi arlu1201,
    Yes, you are absolutely right about it. If the value in AL = 0 then only the row in Sheet "Metal" will be deleted.
    Thanks in advance.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Delete merged rows

    Hello fatalcore,

    Here is the code for the two macros that appear in the attached workbook.

    Command Button Code
    Please Login or Register  to view this content.

    Module1 Code to Delete the Rows
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    244

    Re: Delete merged rows

    Hi,Leith Ross

    Thanks for your reply, can u please modify the code a little bit so that the range is not fixed like test2 only. I want it for Test1, Test2 and Test3 also.
    Thanks in advance.

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: Delete merged rows

    Hello fatalcore,

    Sorry, I forgot to remove "test2" from the Find operation. The value to find is passed in as as string. The code should be as below...
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    02-07-2011
    Location
    Bhutan
    MS-Off Ver
    Excel 2007
    Posts
    244

    Re: Delete merged rows

    Thanks mate

+ 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