Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default excel, vba, command button

how do you change a property of a command button that is on sheet 1 o
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 yo

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
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/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default excel, vba, command button

worksheets("Sheet1").CommandButton1.Caption = "button1"

Worksheets("Sheet1").CommandButton1.Top = 900

most properties are the same.

--
Regards,
Tom Ogilvy



"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/



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Command Button Excel 2007 dhstein Excel Discussion (Misc queries) 4 February 15th 09 04:14 PM
command button a word document in excel Krishnakanth Excel Worksheet Functions 2 April 11th 08 03:31 PM
Command Button to store a value in Excel/VBA....... chadtastic[_3_] Excel Discussion (Misc queries) 1 September 3rd 07 06:36 PM
adding a command button to an excel cell? betelguese Excel Discussion (Misc queries) 1 March 22nd 05 03:09 AM
command button in excel will move when print. [email protected] Excel Discussion (Misc queries) 1 December 29th 04 03:53 PM


All times are GMT +1. The time now is 10:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"