View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default excel, vba, command button

If the command button is from the Controls tool bar, use code
like

Worksheets("Sheet1").OLEObjects("CommandButton1"). Object.Caption
= "Text"

If the command button is from the Forms tool bar, use code like

Worksheets("Sheet1").Buttons("Button 1").Text = "Test"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"jimx " wrote in message
...
how do you change a property of a command button that is on

sheet 1 of
excel worksheet FROM subroutine in vba?

does the command button have the same properties like in visual

basic?
ex:
sub change()
command.caption = "button1"
command.top = 900
end sub

??
thank you


---
Message posted from http://www.ExcelForum.com/