Delete row of data on worksheet

  • Hi Carim

    This is pretty well what you had sent me yesterday, except you adjusted the sheet designations on line 7, but that isn't my problem. I've adjusted for that.

    My issue is with line 11. Shouldn't we be referring to the main sheet 'Sheet12' which is the actual target? Also shouldn't it be outside of the loop, so it only deletes once? instead of Sheets(i) which mimics the deletions orchestrated in line #10

    The code that you sent me in thread #11 had structure that worked, but we're not applying the same here. If you go back to that thread, and compare the event code in that file to what we have now, you'll see what I mean.

    in any event I'm getting error "object required" on line 11 either way

    Thanks for your patience... Jimmy

    Thanks for your help

    JimmyB


    Some plans fail on execution

    All plans fail without

    8)

  • Hi Jimmy,


    Sorry for my typing boo-boo ...?(:S;(


    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Hi Jimmy,


    Sorry for ALL my typing boo-booS ...?(:S:cursing::evil:8o=O



    Hope this latest macro will solve the issue ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Sorry Carim,

    There's no error code, but when it runs it only deletes the original target in sheet 12...none of the other sheets (13 to 21):/

    Thanks for your help

    JimmyB


    Some plans fail on execution

    All plans fail without

    8)

  • The sad thing is that ... without a workbook ... macro cannot be tested ... !!!


    Below is a modification in the event macro which hopefully will function ...


    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Still not running. I got error: Object required on Line 14...but nothing else happened.

    You mentioned that if you had the workbook, you could probably help better, so I pasted the extra 8 sheets into the file that you previously sent me. Hope that this helps solve the issue.

    To help eliminate confusion, I adjusted all of the sheet #'s to match my workbook.

    Thanks Jimmy :)

    Test DeleteRow JimmyB .xlsm

    Thanks for your help

    JimmyB


    Some plans fail on execution

    All plans fail without

    8)

  • Thanks for the file ...


    Looks like sheets are password protected ...


    Therefore ... quite naturally .. nothing can work ...

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Silly ME :S

    If you place this code in the workbook event it will allow macros to run in password protected sheets. If that doesn't work the password is right there in the code



    Code
    1. Dim ws As Worksheet
    2. For Each ws In ThisWorkbook.Worksheets
    3. ws.Protect "Pamela491", UserInterfaceOnly:=True, DrawingObjects:=True, Contents:=True, Scenarios:=True
    4. Next ws
    5. 'This allows the macros to run on protected sheets

    Thanks for your help

    JimmyB


    Some plans fail on execution

    All plans fail without

    8)

  • Hi Carim

    Have you had a chance to check out the issue?

    Thanks Jimmy

    Thanks for your help

    JimmyB


    Some plans fail on execution

    All plans fail without

    8)

  • Hello Jimmy,


    Below is your revised event macro



    Hope this will finally solve your ' delete ' issue ...;)

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • Hi Carim.

    Sorry to say, it deletes the initial row in "VALUES for MEALS" (Sheet12) but doesn't touch 13 to 21...no error, just does nothing

    Jimmy

    Thanks for your help

    JimmyB


    Some plans fail on execution

    All plans fail without

    8)

  • Sorry to say macro was tested ... and does function as expected ...


    Unfortunately ... am not sitting next to you to find out what might be your next obstacle ...

    after the full-fledged protection of all the sheets

    If you feel like saying "Thank You" for the help received, do not hesitate to click the "Like" icon ...just below...in the bottom right corner...:)

  • ok Carim. I'm quite sure you've given me exactly what I need...I just need to incorporate it in. I'm sure that I'll find out what is wrong on my end. The syntax is right and that is where I often struggle. It works on your end and that's what I need to hear. So Thanks a ton. It is really very much appreciated.


    You know, you've helped me a lot on this program over the past months. I'm almost finished with the program. If you'd like to see what you, (and others at OzGrid), have been helping me develop, just click on the link of my You Tube channel in my profile. There is a series of videos, showing myself actually running the program as an instructional feature.

    There's also my website etc...

    Thanks again

    Jimmy

    Thanks for your help

    JimmyB


    Some plans fail on execution

    All plans fail without

    8)

  • Well I can't find anything that should be interfering with the code that you provided. (and it works on your computer arggh) Will keep trying

    Jimmy

    Thanks for your help

    JimmyB


    Some plans fail on execution

    All plans fail without

    8)

  • Hi Carim

    I played around a bit and got it to work. Your code helped loads. Really appreciate it

    I can finally put this one to rest

    Don't forget to check out my You Tube channel. I have made improvements since the videos (like ScreenUpdating) etc but you'll get the idea. Just send me a comment on any of my sites. (You Tube, Blog, Website, GoFundMe... I check them daily.

    Thanks again Carim

    Jimmy ;):!:

    Thanks for your help

    JimmyB


    Some plans fail on execution

    All plans fail without

    8)