+ Reply to Thread
Results 1 to 4 of 4

Locked and Unlocked text in VBA textbox on a Userform.?

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Mumbai, IN
    MS-Off Ver
    Office 365
    Posts
    97

    Locked and Unlocked text in VBA textbox on a Userform.?

    What I want to do is: I want to have a Certain Text in a textbox which cannot be edited. One can edit anything before or after that but not that string.

    For instance- A textbox's default value is "Security Verification: "
    what i want is that this string of security verification cannot be edited. if a user selectes before the s of the security then he is able to write anything he wishes there, and also he is able to write anything after verification, but nowhere in middle of security verification

    i know it can be done, but dont know how. my textbox is named notes

  2. #2
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: Locked and Unlocked text in VBA textbox on a Userform.?

    Try something like this:
    Please Login or Register  to view this content.
    多么想要告诉你 我好喜欢你

  3. #3
    Registered User
    Join Date
    09-27-2012
    Location
    Mumbai, IN
    MS-Off Ver
    Office 365
    Posts
    97

    Re: Locked and Unlocked text in VBA textbox on a Userform.?

    Quote Originally Posted by millz View Post
    Try something like this:
    Please Login or Register  to view this content.
    Thank You for shifting me in the Right direction. I might be asking too much of you. But is it possible that if the person is not able to change "Security " and is not able to change "Verfication: " But is able to write anything between them. Essentially what i want to do is for example a person enters "`ST" then the default text changes to "ST:" and then an editable range and then that security verification thing...

    so in general what i want is to be able to change default value of a textbox which remains locked. on certain codes like `stp which then changes the default text and keeps it locked but in that locked text i need an editable range like lets say the dfault value of a text is "ST:P POC:Y SV() CV)" this text is locked
    only if i enter `sta the default value should change to "ST:A" or else if i click anywhere on "ST:" like your previous example all i want is that it selects the "P" or "A" or whatever appears there so that i can change it
    secondly if you notice i can brackets in the default string. what i want is that if i click between those brackets i want to be able to write anything (so the brackets cannot be deleted all it does is just adds whatever i right but that default text unless i put a string like `STP or POCN it doesnt change.

    Please help i have broken my head over it.

  4. #4
    Registered User
    Join Date
    09-27-2012
    Location
    Mumbai, IN
    MS-Off Ver
    Office 365
    Posts
    97

    Re: Locked and Unlocked text in VBA textbox on a Userform.?

    OR easier to explain how can i have another string lets say "Changes Made: " added to the same textbox in which the Changes Made is locked and everything else is editable. May be you are able to see where i am going. i am trying to make like a short hands notes makes, where as and when i take certain action on an account. i note is in codes and the text box changes the values smartly to where they belong. i have an array of those short hand notes.....long story. ..haha. plase help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 23
    Last Post: 07-12-2014, 07:09 PM
  2. Locked textbox clears text when command button clicked.
    By cocobean in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-14-2012, 02:53 AM
  3. Highlighting Locked/Unlocked Cells
    By jderren in forum Excel General
    Replies: 2
    Last Post: 10-04-2010, 03:26 PM
  4. When protecting workbook with pw, unlocked cells are still locked
    By Launchnet in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 12-18-2009, 12:52 AM
  5. Searching for locked/unlocked cells
    By Karthik Bhat - Bangalore in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2005, 11:05 PM

Tags for this Thread

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