Thread: command buttons
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default command buttons

Name or caption. (I assume caption)
each has their own property window.

you can do it with code if there is some pattern to your madness

Dim oleObj as Object
Dim cbtn as MSforms.Commandbutton
Dim sRoot as String, i as Long
sRoot = "BaseName"
i = 1
for each oleobj in Activesheet.OleObject
if typeof oleObj.Object is MSForms.CommandButton then
set cbtn = oleObj.Object
cbtn.Caption = sRoot & i
'cbtn.name = sRoot & i
i = i + 1
end if
next

If you change the name (not the caption), any event code will need to be
changed to reflect the new name.

--
regards,
Tom Ogilvy


"wildauk" wrote in message
...
Hi, I have a large number of command buttons and I need to change the name
on
them, they all have the same name, I know that I can change the name by
using
edit but I was wondering if there is a quick way to do it with more than
one
at a time, I have about 300 buttons in two rows down two columns.

Thanks in advance, Wildauk.