+ Reply to Thread
Results 1 to 8 of 8

Locking Selected Cells When Form Button is Pressed. HELP!

  1. #1
    Registered User
    Join Date
    04-09-2013
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    4

    Locking Selected Cells When Form Button is Pressed. HELP!

    Hi guys, I'm new in Excel VBA coding, and I need to create a macro that whenever I input someting in a cell, then I pressed the form button I made, the selected cells with be locked. Please help me....

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Locking Selected Cells When Form Button is Pressed. HELP!

    Hey!!

    You can use something like this -

    Please Login or Register  to view this content.
    Between the mentioned range in the code, the code will run and unlock all the cells, then it will go through every cell and if the cell is non blank, it will lock it and protect the sheet.

    Is this what you are looking for??

    Thank you,

    Deep
    Attached Files Attached Files
    Cheers!
    Deep Dave

  3. #3
    Registered User
    Join Date
    04-09-2013
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Locking Selected Cells When Form Button is Pressed. HELP!

    Hi. Thank you so much it worked! Though when I merge your code to the worksheet I made, there was Error 400. I don't know what it is. Can you pls take a look at my worksheet?

    Cells in column E needs to be locked everytime a date has been enter. But there seems to be an error combine you codes to mine.

    Here the link of the worksheet. https://dl.dropboxusercontent.com/u/...Tool%20(3).xls

    sorry I can't attach it here.

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Locking Selected Cells When Form Button is Pressed. HELP!

    I am unable to attach the corrected file.

    Kindly PM me your E-Mail id where I can E-mail you the file.

    Thank You,

    Deep

  5. #5
    Registered User
    Join Date
    04-09-2013
    Location
    Manila, Philippines
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Locking Selected Cells When Form Button is Pressed. HELP!

    you can send it to me at [email protected]

    Thank you so much!

  6. #6
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Locking Selected Cells When Form Button is Pressed. HELP!

    Mail Sent!!

    Thank You,

    Deep

  7. #7
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Locking Selected Cells When Form Button is Pressed. HELP!

    Hi, Deep,

    as this is a forum any solution provided must be posted here.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  8. #8
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Locking Selected Cells When Form Button is Pressed. HELP!

    Oooops, I am so sorry.

    Below is the code -

    Please Login or Register  to view this content.
    Just minor changes to the above code!

    Thank You,

    Deep

+ 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