PC Review


Reply
Thread Tools Rate Thread

Copy button caption

 
 
John Pierce
Guest
Posts: n/a
 
      10th Aug 2007
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.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?RlN0MQ==?=
Guest
Posts: n/a
 
      10th Aug 2007
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.
>
>

 
Reply With Quote
 
John Pierce
Guest
Posts: n/a
 
      16th Aug 2007
On Aug 10, 1:08 pm, FSt1 <F...@discussions.microsoft.com> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Button Caption help Jim Brooks Microsoft Access Getting Started 3 6th Feb 2010 12:18 PM
VBA to create button on sheet after copy and to change the caption ArielZusya Microsoft Excel Programming 7 16th Jan 2008 09:59 PM
Created custom caption bar - need help with caption button positio =?Utf-8?B?TWFyaXVzSQ==?= Microsoft Dot NET Framework Forms 0 28th Jun 2005 08:21 AM
Button Caption? MJJ Microsoft Access 1 6th Jun 2004 01:49 AM
Caption of a button Dr_Phil Microsoft Excel Programming 4 4th May 2004 09:13 PM


Features
 

Advertising
 

Newsgroups
 


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