Full Version: how can I use user Form on a protected sheet.
UtterAccess Discussion Forums > Microsoft® Office > Microsoft Excel
aali_dad
Hello Dear All

I have got a user form in Excel, but i am not sure whether i can use it in a protected sheet or not because once i have tried but it give me debug error. So may be something i should add in my code.

I have attached the screenshot of that code.

Thanx in advance.
Ali
strive4peace
Hi Ali,

It appears that your routine is:

1. looping through column A until it comes to an empty cell (presumably also an empty row)
2. then you are writing a value to column A, B, C, and D --> if the worksheet is protected, this will not be allowed unless the cells are unlocked or you unprotect the sheet first in your code

Also, there are better ways to find the first empty cell in column A... try this:

CODE
sub FindNextEmptyRow()
   Dim mRow As Long
   mRow = Range("A2").End(xlDown).Row + 1
   MsgBox mRow
End Sub
aali_dad
Hi
Thanx for the small quicky code.
Well I tried to find the way to solve my problem.

I just insereted another worksheet. And I added a button as same as in my "check" worksheet and i called all the cells from my "Check" Worksheet.
Then i protected that because i don't want any one to Edit my values, that's why i did it.

And finally I hide my original Check worksheet.

Now when i click on my Button so it appears the form and when i enter the value it goes to "check" Worksheet and i can see the values in another sheet which is protected.

Thanx for a help
I tried to share how i solved my problem.

Thanx
Ali
strive4peace
you're welcome, Ali wink.gif happy to help
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.