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

hi, how do you change the caption of a button from VBA code. The button
is on a sheet called XS003 if that helps......

from VB it is commandbutton1.caption = "blah blah blah"

but that dosnt seem to work

any help would be appreciated....

thanx


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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Caption of a button

Hi

Sure it seems to work.

Private Sub CommandButton1_Click()
Sheets(1).CommandButton1.Caption = Now
End Sub

HTH. Best wishes Harald

"Dr_Phil " skrev i melding
...
hi, how do you change the caption of a button from VBA code. The button
is on a sheet called XS003 if that helps......

from VB it is commandbutton1.caption = "blah blah blah"

but that dosnt seem to work

any help would be appreciated....

thanx


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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Caption of a button

yea that does work....but i forgot to say that when my sheet loads i
automativlly adds a command button to it.....let me xplain

i have workbook A and when the user types a file name on that sheet an
clicks open it opens that file....now when that file opens i want it t
add a button to it which will say save and close....this is to make i
easer for my staff to use as i need it to be correctly named etc etc..
hope that makes sense

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,327
Default Caption of a button

"Dr_Phil " skrev i melding
...
i forgot to say that when my sheet loads it
automativlly adds a command button to it.(...)
when that file opens i want it to
add a button to it which will say save and close


It's not too clear what works and what doesn't. Please post the code that
adds the button if you have it, including the "dosnt seem to work" parts.

Best wishes Harald


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Caption of a button

hi,

right:


I have a workbook that has an open button on it with a space for a use
to enter a file name into, eg "hello". When the user clicks the butto
the workbook will add ".csv" to the file name and open it. When thi
new workbook opens, "hello.csv", i want a button to be placed on i
with the caption "Save".

I hope this makes sense

--
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
Change caption of a button Dylan @ UAFC[_2_] Excel Worksheet Functions 3 November 25th 08 07:04 PM
Put Wingdings Characters in Toolbar button caption- IF POSSIBLE chris Excel Discussion (Misc queries) 0 July 6th 06 08:18 PM
Change caption on a macro button gbeard Excel Worksheet Functions 3 April 21st 05 01:43 PM
Toggle custom button caption Tummy Excel Programming 4 February 23rd 04 07:40 PM
Cannot Get Caption to show on custom toolbar button Rob Bovey Excel Programming 1 August 1st 03 02:38 AM


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

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

About Us

"It's about Microsoft Excel"