+ Reply to Thread
Results 1 to 7 of 7

Protecting row.count - 1 when inserting from userform

  1. #1
    Forum Contributor timtim89's Avatar
    Join Date
    01-05-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    141

    Protecting row.count - 1 when inserting from userform

    Hi,

    I'm inserting content from a userform into an excel sheet. The sheet is locked, but I want to be able to change the last row that has been inserted. It's probably the Range that I'm not defining right, but hopefully someone can help me out. Thanks in advance for your help and effort.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Protecting row.count - 1 when inserting from userform

    Hi timtim89, your worksheet is password protected.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

  3. #3
    Valued Forum Contributor mohd9876's Avatar
    Join Date
    05-04-2011
    Location
    Amman, Jordan
    MS-Off Ver
    Excel 2010
    Posts
    426

    Re: Protecting row.count - 1 when inserting from userform

    the problem is probably in this line:
    Please Login or Register  to view this content.
    it should be like this
    Please Login or Register  to view this content.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Protecting row.count - 1 when inserting from userform

    This suffices:
    Please Login or Register  to view this content.



  5. #5
    Forum Contributor timtim89's Avatar
    Join Date
    01-05-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    141

    Re: Protecting row.count - 1 when inserting from userform

    Thanks for all your suggestions. Unfortunately none of them solved the problem.

    mordred: the password is written in J10. My bad that I didn't highlight it somehow.

    mohd9876: I get a run-time error '1004' on the line, unfortunately.

    snb: When I exit the userform the whole sheet is still protected (including the last line).

    If someone can solve it by changing my initial code it would be preferable as I am familiar with that one. I know it's probably a clumsy one, though thanks again for looking into my problem.

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Protecting row.count - 1 when inserting from userform

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor timtim89's Avatar
    Join Date
    01-05-2012
    Location
    Copenhagen, Denmark
    MS-Off Ver
    Excel 2010
    Posts
    141

    Re: Protecting row.count - 1 when inserting from userform

    snb, thanks for your effort. On the last code I get a run-time error 438 saying that object doesn't support this property or method, while highlighting the "Rows()..Resize()..Protect.." line. This was after adding an "End With" to your code btw. So the problem is still there..
    Last edited by timtim89; 02-17-2012 at 01:08 PM.

+ 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