View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
hdf hdf is offline
external usenet poster
 
Posts: 30
Default Can I use VBA to change name and controlsource

On Mar 5, 7:31 pm, "Bob Phillips" wrote:
Why would you not just set these as required in design mode?

--
---
HTH

Bob


I'm trying to avoid manually having to write the name and range name
in controlsource over and over 80 userforms x 20 chkboxes per form x 2
changes per userform.

By creating code I can simply create one set of instructions for the
first UserForm, use it once, then do a search and replace in the code
for the number (e.g. search for "Uf1" in the names called
"Uf1_name1...Uf1_name20" and Replace with "Uf2", etc.) and then run
the code again for the next UserForm and do this for each new
UserForm.

This would speed up the work a hundred fold, plus it avoids or limits
the chances for spelling errors.