+ Reply to Thread
Results 1 to 13 of 13

macro to stop a user from editing/removing data after a button is clicked

  1. #1
    Registered User
    Join Date
    08-15-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    38

    macro to stop a user from editing/removing data after a button is clicked

    hi i need to stop the user from modifying the data once he has clicked the update button say the data is in range a1:m100 , i need a macro to somehow lock the data

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: macro to stop a user from editing/removing data after a button is clicked

    At the bottom of your update button code before END SUB add this
    Please Login or Register  to view this content.
    when the user clicks the button all the cells in the range have their Locked attribute set to true then the sheet protected with the password password
    Not all forums are the same - seek and you shall find

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: macro to stop a user from editing/removing data after a button is clicked

    Try this, amend the sheet reference
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  4. #4
    Registered User
    Join Date
    08-15-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: macro to stop a user from editing/removing data after a button is clicked

    brilliant.one more thing can i incoperate the lastrow thing for example from columns a through m i want to lock the cells to the point where the last data exists

  5. #5
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: macro to stop a user from editing/removing data after a button is clicked

    for last row:
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    08-15-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: macro to stop a user from editing/removing data after a button is clicked

    can i lock the macro with a password because i will be providing this sheet to customers

  7. #7
    Registered User
    Join Date
    08-15-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: macro to stop a user from editing/removing data after a button is clicked

    the lastrow code is giving error application defined or object defined error

  8. #8
    Registered User
    Join Date
    08-15-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: macro to stop a user from editing/removing data after a button is clicked

    k have protected the macro too just need help with the lastrow thing

  9. #9
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: macro to stop a user from editing/removing data after a button is clicked

    LastRow works fine for me, care to show us how you are using it?

  10. #10
    Registered User
    Join Date
    08-15-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: macro to stop a user from editing/removing data after a button is clicked

    i have fixed it i m a attaching my workbook somehow all the ranges are being locked whereas i wanted it to be a

  11. #11
    Registered User
    Join Date
    08-15-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: macro to stop a user from editing/removing data after a button is clicked

    i wanted it to be *a1:a5

  12. #12
    Registered User
    Join Date
    08-15-2011
    Location
    Pakistan
    MS-Off Ver
    Excel 2007
    Posts
    38

    Re: macro to stop a user from editing/removing data after a button is clicked

    here is the workbook some how all the ranges are being locked i want it to be a1:a5 only ...password is "haha"
    Attached Files Attached Files

  13. #13
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161

    Re: macro to stop a user from editing/removing data after a button is clicked

    Use this for the xpanding range
    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)

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