+ Reply to Thread
Results 1 to 9 of 9

Deleting data with VBA

  1. #1
    Registered User
    Join Date
    11-30-2012
    Location
    Malta
    MS-Off Ver
    Excel 2010
    Posts
    28

    Deleting data with VBA

    Hi

    I need to create a code with VBA which does the following:

    A user form will prompt the user to enter a serial number. The code will then search all the worksheets within a work book for this serial number. If found, all data in the row containing that number (i.e.. adjacent to that number) must be deleted. Also, all data below it must be shifted up one row to take its place.

    Any idea how to do this please?

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Deleting data with VBA

    I can provide you code but you have to create a userform with textbox and commandbutton, is this deal ok?


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    11-30-2012
    Location
    Malta
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Deleting data with VBA

    Yes sure...shall I send you the excel sheet?

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Deleting data with VBA

    Yes attach here please...

  5. #5
    Registered User
    Join Date
    11-30-2012
    Location
    Malta
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Deleting data with VBA

    See attachment
    Attached Files Attached Files

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Deleting data with VBA

    What to do if multiple matches are found?

  7. #7
    Registered User
    Join Date
    11-30-2012
    Location
    Malta
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: Deleting data with VBA

    delete all matches

  8. #8
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Deleting data with VBA

    Try this code. It deletes the entire row if it finds the series number entered by the user.

    Please Login or Register  to view this content.

  9. #9
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Deleting data with VBA

    Try this code. It deletes the entire row if it finds the series number entered by the user.

    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)

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