+ Reply to Thread
Results 1 to 5 of 5

Changing Form Control Names in a loop

  1. #1
    Forum Contributor
    Join Date
    06-12-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    167

    Changing Form Control Names in a loop

    Hello,

    I currently have what will amount to be 300 controls that need new names and in some case captions. They follow an easy to loop through naming convention so I am trying to write a simple macro to save me a few hours worth of clicking and typing. I am getting an error of can not set the name property. Can not set property at runtime. I am wondering if this means I am out of luck and get to spend the rest of the day clicking around or if my code below just has errors.

    Please Login or Register  to view this content.
    Thanks

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,230

    Re: Changing Form Control Names in a loop

    Upload a sample file we can make use of please...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Contributor
    Join Date
    06-12-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    167

    Re: Changing Form Control Names in a loop

    It is a massive form so I did not take the time to clear everything out but I want to update the Paper Machine Page which is on the Systems Page. I am adding 20 more lines to the frame there and I need them to follow the same naming convention for looping purposes in the rest of the code I have. I will end up needing to do this in a few other places as well as add a few new columns to the frame but if I can get the 20 new to work I can adjust for the rest.

    Form is FSRForm

    Code in Module 1
    Attached Files Attached Files

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,230

    Re: Changing Form Control Names in a loop

    Firstly, it is not possible to change the controls name while code is running...Can set it via Property...
    Caption change is as per your code...Put your code in a command Button on userForm.

    Please Login or Register  to view this content.
    Last edited by sintek; 01-04-2018 at 02:56 PM.

  5. #5
    Forum Contributor
    Join Date
    06-12-2017
    Location
    USA
    MS-Off Ver
    2010
    Posts
    167

    Re: Changing Form Control Names in a loop

    That's unfortunate thanks

+ 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: 1
    Last Post: 02-17-2015, 07:01 AM
  2. Changing box and font size in form control check boxes?
    By Hambone70 in forum Excel General
    Replies: 3
    Last Post: 08-13-2014, 10:16 AM
  3. Replies: 0
    Last Post: 03-18-2013, 08:43 PM
  4. Changing Cell Link for Check Box Form Control
    By fervorking in forum Excel General
    Replies: 2
    Last Post: 09-02-2011, 03:12 PM
  5. Replies: 1
    Last Post: 03-15-2011, 04:59 PM
  6. Changing CheckBox Control Names
    By grime in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-27-2005, 09:05 AM

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