+ Reply to Thread
Results 1 to 6 of 6

Editing recorded macro for deleting rows in a protected sheet

  1. #1
    Registered User
    Join Date
    01-06-2013
    Location
    uae
    MS-Off Ver
    Excel 2010
    Posts
    12

    Editing recorded macro for deleting rows in a protected sheet

    Hi guys,

    I badly need some help. I am clueless about programming. I wanted to delete rows in a protected sheet, and i Learned you cannot do that if your rows have formulas even if you tick the DELETE ROWS column while protecting the sheet. Hence, I learned about Recording macros. I record a macro to unprotect the sheet, delete the rows and protect the sheet again.

    However, the recorded macro always deletes the same 3 rows that I selected while recording the macro. I want to edit the macro so that it can delete the desired no. of SELECTED rows or ACTIVE ROWS. I have tried quite a few things but nothing works.I dont know what I am doing wrong. Please modify this macro for me in a simple manner as I dont know any programming

    This is the macro as I see it when I go to edit it

    Sub Macro1()
    '
    ' Macro1 Macro
    '
    ' Keyboard Shortcut: Ctrl+q
    '
    ActiveSheet.Unprotect
    Range("A4:A6").Select
    Selection.EntireRow.Delete
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True _
    , AllowDeletingRows:=True
    End Sub

    I want to change the RANGE ("A4:A6") so that I can delete all the rows that I have selected instead of just these three rows. Make it general.

    Any help would be really great

    Thanksa lot

  2. #2
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Editing recorded macro for deleting rows in a protected sheet

    Please put your code in
    Please Login or Register  to view this content.
    and it will delete whatever row you currently have selected.

  3. #3
    Registered User
    Join Date
    01-06-2013
    Location
    uae
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Editing recorded macro for deleting rows in a protected sheet

    OMG thank you SOOOO Much.....

  4. #4
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Editing recorded macro for deleting rows in a protected sheet

    Sure. Please mark the thread solved, and any reputation points would be appreciated.

  5. #5
    Registered User
    Join Date
    01-06-2013
    Location
    uae
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Editing recorded macro for deleting rows in a protected sheet

    Reputation points????Wats that and how to go about it...will surely do it if it helps you....

  6. #6
    Forum Expert
    Join Date
    08-28-2014
    Location
    Texas, USA
    MS-Off Ver
    2016
    Posts
    1,796

    Re: Editing recorded macro for deleting rows in a protected sheet

    Oh, no big deal, just the little *Add Reputation text at the bottom of each post.

+ 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. Editing a recorded macro of a csv import error
    By jcmc2112 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-14-2014, 09:24 AM
  2. [SOLVED] Help making recorded macro work on protected sheet
    By EmmaOD in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-21-2013, 01:59 PM
  3. [SOLVED] Deleting rows with Advance Filter in recorded Macro
    By JHL in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-24-2006, 03:35 PM
  4. [SOLVED] Excel macro, editing recorded cell.. not current
    By TroyT in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-12-2006, 09:30 AM
  5. [SOLVED] Editing recorded macro code. Referencing workbook name in functio
    By Mark in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-06-2005, 07:06 PM

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