+ Reply to Thread
Results 1 to 3 of 3

Expand Code that finds and deletes names from current sheet to all worksheets in workbook

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    Chicago, United States of America
    MS-Off Ver
    Excel 2010
    Posts
    35

    Expand Code that finds and deletes names from current sheet to all worksheets in workbook

    Hello!

    Currently I have code that searches for an individual's last name in column A , finds the row, and deletes the row. This works perfectly on the active sheet I am on. (Inspiration from http://tinyurl.com/m5mbanb)

    In my workbook, I have several worksheets corresponding to each week of the year. I hope to have the code I have iterate through each worksheet and delete the same name from Column A in each worksheet. The catch is that the name will not be in the same row on each sheet. Thus, the string needs to be found again on each sheet.

    I have attempted to use a For each statement; however, that yields an error. Additionally I have attempted to set up array variables where the name location can be saved but I have been unsuccessful
    Please Login or Register  to view this content.


    Code:
    Please Login or Register  to view this content.



    If anyone has any thoughts, I would really appreciate it.

    Best,

    Grazian2
    Last edited by grazian2; 08-01-2013 at 10:18 AM.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Expand Code that finds and deletes names from current sheet to all worksheets in workb

    What is the error you get with the For Each Loop? It should go something like this:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    06-19-2013
    Location
    Chicago, United States of America
    MS-Off Ver
    Excel 2010
    Posts
    35

    Re: Expand Code that finds and deletes names from current sheet to all worksheets in workb

    That is the code I attempted to put in.

    Sorry for not being specific.

    The error I receive is "Delete method of range class failed", and the code that is highlighted is as follows

    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. VBA code to copy data from specific worksheets from current workbook to a new one
    By Uday2013 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-01-2013, 12:15 PM
  2. [SOLVED] Edit the code so that it loops through all worksheets and deletes column with "grand" text
    By rocksan in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-13-2012, 02:58 AM
  3. Export worksheets from a workbook to the current workbook location path
    By legendkiller420 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2010, 04:08 AM
  4. [SOLVED] Addin macro to delete names in current workbook
    By David Iacoponi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2005, 02:05 PM
  5. Help with code that finds a sheet's name
    By KimberlyC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-10-2005, 06:05 PM

Tags for this Thread

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