+ Reply to Thread
Results 1 to 3 of 3

Dynamically create textbox in sheet with change control.

  1. #1
    Registered User
    Join Date
    09-01-2020
    Location
    fort worth, texas
    MS-Off Ver
    8
    Posts
    2

    Dynamically create textbox in sheet with change control.

    Hello,

    I have a spreadsheet created in another program that gets pasted into a blank excel sheet and then I run a macro. The macro sorts and divides the information into about 50 sheets including 2 summary sheets. I am trying to search column "A" of those sheets (one at a time) instead of scrolling for a name. I have written code to create the textbox and the code for the change event that is functioning when manually inserted into the text box in design mode. What I need help with is getting the textbox to work during run time instead of manually inserting the code each time. All of the code is currently in a module. I have tried using a class module without success. All help or alternatives are welcome. Thank you

    This code is within my larger sub within a module:
    Please Login or Register  to view this content.
    This code is what I paste into the textbox view code option which places it in a worksheet:
    Please Login or Register  to view this content.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,480

    Re: Dynamically create textbox in sheet with change control.

    Add code to the activesheet module

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    09-01-2020
    Location
    fort worth, texas
    MS-Off Ver
    8
    Posts
    2

    Re: Dynamically create textbox in sheet with change control.

    Thank you Dave,
    The code works really well. I had one issue with this line
    Please Login or Register  to view this content.
    returning a subscript out of range error. I found that if I named the worksheet it would give me the error, but if I ran the code and then named the worksheet it was just fine. There is probably a good reason for that and a way to fix it, but my work around of creating the sheet, running your code and then naming the sheet worked just fine. I really appreciate it!!!

+ 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. [SOLVED] How to dynamically change linked cell for spinbutton control
    By bluphoto in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-10-2018, 07:33 AM
  2. [SOLVED] Put Multiple Lines in Single Textbox Dynamically from Sheet
    By AmirSoft in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-06-2015, 12:27 PM
  3. Replies: 11
    Last Post: 01-20-2015, 09:34 AM
  4. [SOLVED] Change width of Textbox dynamically
    By naveenmarapaka in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2014, 07:52 AM
  5. [SOLVED] TextBox user input to change text in content control with VBA?
    By EnigmaMatter in forum Word Formatting & General
    Replies: 2
    Last Post: 09-06-2014, 06:56 PM
  6. [SOLVED] Trying to change the textbox's Control source
    By whatsmyname in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-08-2013, 05:07 PM
  7. Add control dynamically and change the position of the control
    By annpricks in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-31-2012, 12:57 AM

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