Thanks for the update. This what I also think. But I am not able to know its value. I have a userform1 which has a textbox1 where user enter some value. I would like to know what is the value. Below are the code.
Private Sub CommandButton1_Click() Dim WSheet As Worksheet For Each WSheet In Worksheets If WSheet.ProtectContents = True Then WSheet.Unprotect Password:=TextBox1.Text Else 'WSheet.Protect Password:=TextBox1.Text, DrawingObjects:=True, Contents:=True, Scenarios:=True WSheet.Cells.Locked = True WSheet.Protect Password:=TextBox1.Text End If Next WSheet Unload Me End Sub From: excel-macros@googlegroups.com [mailto:excel-mac...@googlegroups.com] On Behalf Of Deepak Rai Sent: Thursday, November 11, 2010 10:53 PM To: excel-macros@googlegroups.com Subject: Re: $$Excel-Macros$$ how to know the content of a text box of user form Hi Hiren, Suppose I have a veriable called Fname now I have to get this variable's value from a Texbox in a user control. Lets take this Text Box name as Textbox1 now I will use Fname = Textbox1.value to populate my Fname variable with the value present in the Text Box. Textbox1.value is the answer of your question. :) Hope this example will help you. Regards, Deepak On Thu, Nov 11, 2010 at 8:52 PM, Hiren Sheth <hiren.sh...@viteos.com<mailto:hiren.sh...@viteos.com>> wrote: Hi, Please let me know how to obtain the content of a text box of user form? Thanks Hiren This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mis-transmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Viteos Capital Market Services Ltd.and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com<http://www.excel-macros.blogspot.com/> 4. Learn VBA Macros at http://www.quickvba.blogspot.com<http://www.quickvba.blogspot.com/> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com<http://exceldailytip.blogspot.com/> To post to this group, send email to excel-macros@googlegroups.com<mailto:excel-macros@googlegroups.com> <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wall&ref=ts -- Regards, Deepak Rai -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com<mailto:excel-macros@googlegroups.com> <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wall&ref=ts This message is for the named person's use only. It may contain confidential, proprietary or legally privileged information. No confidentiality or privilege is waived or lost by any mis-transmission. If you receive this message in error, please immediately delete it and all copies of it from your system, destroy any hard copies of it and notify the sender. You must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message if you are not the intended recipient. Viteos Capital Market Services Ltd.and any of its subsidiaries each reserve the right to monitor all e-mail communications through its networks. Any views expressed in this message are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of any such entity -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/pages/discussexcelcom/160307843985936?v=wall&ref=ts