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

While using another data base program, I often toggle over to an excel
spreadsheet that has frequently used blurbs in separate cells. I would
then click on the appropriate cell, press Ctrl+C to copy the contents,
and toggle back to my database and paste the blurb. I figured out that
I could save a little effort by making a button with a macro that
copies the blurb with one click, but it is quite elaborate to set up:
type the blurb, name the range, create a macro that copies the range,
create the button, attach the macro. Then I thought "why not just have
buttons whose labels (captions) are the blurbs?!" So, can I create a
forms button whose "text" caption can be copied when clicked, and, if
so, how? Or, as I am thinking, will it need to be a Command button
with caption property - click the button and copy the caption.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default Copy button caption

hi,
you copy stuff in cells. a command button is an object with properties so
you do that a tad different.
Private Sub cb1_Click()
Dim c As String
c = cb1.Caption
Range("A1").Value = c
End Sub
maybe this will get you pointed in the right direction,
regards
FSt1
"John Pierce" wrote:

While using another data base program, I often toggle over to an excel
spreadsheet that has frequently used blurbs in separate cells. I would
then click on the appropriate cell, press Ctrl+C to copy the contents,
and toggle back to my database and paste the blurb. I figured out that
I could save a little effort by making a button with a macro that
copies the blurb with one click, but it is quite elaborate to set up:
type the blurb, name the range, create a macro that copies the range,
create the button, attach the macro. Then I thought "why not just have
buttons whose labels (captions) are the blurbs?!" So, can I create a
forms button whose "text" caption can be copied when clicked, and, if
so, how? Or, as I am thinking, will it need to be a Command button
with caption property - click the button and copy the caption.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Copy button caption

On Aug 10, 1:08 pm, FSt1 wrote:
hi,
you copy stuff in cells. a command button is an object with properties so
you do that a tad different.
Private Sub cb1_Click()
Dim c As String
c = cb1.Caption
Range("A1").Value = c
End Sub
maybe this will get you pointed in the right direction,
regards
FSt1



"John Pierce" wrote:
While using another data base program, I often toggle over to an excel
spreadsheet that has frequently used blurbs in separate cells. I would
then click on the appropriate cell, press Ctrl+C to copy the contents,
and toggle back to my database and paste the blurb. I figured out that
I could save a little effort by making a button with a macro that
copies the blurb with one click, but it is quite elaborate to set up:
type the blurb, name the range, create a macro that copies the range,
create the button, attach the macro. Then I thought "why not just have
buttons whose labels (captions) are the blurbs?!" So, can I create a
forms button whose "text" caption can be copied when clicked, and, if
so, how? Or, as I am thinking, will it need to be a Command button
with caption property - click the button and copy the caption.- Hide quoted text -


Okay, I added Range("A1").copy and that works.
Private Sub cb1_Click()
Dim c As String
c = cb1.Caption
Range("A1").Value = c
Range("A1").copy
End Sub
But, I can't help thinking there must be a more elegant way of getting
the caption directly to the clipboard.

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
Toggle Button Caption Al Excel Programming 5 October 20th 06 08:06 PM
Getting Forms button caption Otto Moehrbach Excel Programming 3 September 11th 05 12:11 AM
Command Button Caption Qaspec Excel Programming 1 January 27th 05 03:30 PM
Caption of a button Dr_Phil Excel Programming 4 May 4th 04 09:13 PM


All times are GMT +1. The time now is 05:39 AM.

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"