+ Reply to Thread
Results 1 to 7 of 7

Vba - table insert row - protected sheet

  1. #1
    Registered User
    Join Date
    09-16-2018
    Location
    Washington State, USA
    MS-Off Ver
    2016
    Posts
    43

    Vba - table insert row - protected sheet

    Hey All,

    I have a code that will unlock a protected sheet and insert a new row into the table. (top row of selected range). Problem I am having is its not protecting the sheet with password when finishing up. It's fairly chopped up and I'm hoping someone can help refine this.......newbie here.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Vba - table insert row - protected sheet

    Have you tried stepping through the code line by line using F8 in the VBA Editor? That may tell you which lines are being skipped (or at least enable you to check values of variables involved at each step).

  3. #3
    Registered User
    Join Date
    09-16-2018
    Location
    Washington State, USA
    MS-Off Ver
    2016
    Posts
    43

    Re: Vba - table insert row - protected sheet

    I stripped the overcompicated code down to this. IT work fine but inserts at the bottom of the table. Ideas of how I can get it to insert on the top row?


    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Vba - table insert row - protected sheet

    I'd think using "Range("A1").End(xlDown)" will find the last contiguous used row below cell A1.

    If your table was always in A1:??, then wouldn't you just reference Range("A2")? (I'm guessing it's not that simplistic...)

  5. #5
    Registered User
    Join Date
    09-16-2018
    Location
    Washington State, USA
    MS-Off Ver
    2016
    Posts
    43

    Re: Vba - table insert row - protected sheet

    A16 is the first row of the table, some reason it add only to the bottom......little stumped

  6. #6
    Forum Contributor
    Join Date
    09-19-2018
    Location
    USA
    MS-Off Ver
    2016
    Posts
    208

    Re: Vba - table insert row - protected sheet

    Try this insert line instead:
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-16-2018
    Location
    Washington State, USA
    MS-Off Ver
    2016
    Posts
    43

    Re: Vba - table insert row - protected sheet

    Works perfect!

+ 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. Insert Row on a table in a protected sheet.
    By siroos12 in forum Excel General
    Replies: 2
    Last Post: 07-08-2015, 09:14 AM
  2. Allowing new row insert function to protected table?
    By phatkrome in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-23-2014, 08:45 AM
  3. [SOLVED] Insert row for table on protected worksheet
    By Justair07 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-23-2013, 07:37 AM
  4. Excel 2007 : Insert row while sheet is protected
    By pansovic in forum Excel General
    Replies: 6
    Last Post: 12-15-2010, 10:19 AM
  5. Keep format of data table after insert a new row on a protected sheet
    By RickyC in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-07-2010, 10:58 AM
  6. Replies: 8
    Last Post: 12-11-2009, 04:36 PM
  7. Excel 2007 : Insert Row to a Protected Sheet
    By Justinetme in forum Excel General
    Replies: 1
    Last Post: 08-31-2009, 12:51 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