+ Reply to Thread
Results 1 to 6 of 6

Copy cell contents to Button Label?

  1. #1
    Forum Contributor
    Join Date
    08-28-2006
    Posts
    280

    Copy cell contents to Button Label?

    Hello all,

    I have several buttons, created from the Forms Toolbar. Is it possible to pull the contents (Text) from different cells, to the Buttons as part of the Label on each button?

    Thanks,

    Dean

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Dean England,

    Here's the code...

    Please Login or Register  to view this content.
    To use it...
    This example adds the contents of cell D5 to the label of the Button named "Button 1".

    AddCellToButtonLabel $D5, "Button 1"

    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    08-28-2006
    Posts
    280

    I'm in a dense period

    Hi Leith,

    I've tried your code several ways and I can't seem to get my head around this thing. I think I'm having a bad week today. I don't know what I'm doing wrong, but....... Maybe you could explain it to me like you would a small child.

    I've attached an example of the worksheet.

    Thanks for looking.

    See ya,

    Dean
    Attached Files Attached Files

  4. #4
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482
    Hi,

    Maybe using the buttons from the control toolbox would work.....
    then you could add codes in the worksheet module to work with the command buttons, such as


    Please Login or Register  to view this content.

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Dean,

    I got it working. I didn't know you wanted to dynamically change the button's caption based on the contents of changing cell. Here is the macro, and I already added it to your workbook.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    08-28-2006
    Posts
    280

    Thanks much!!

    Hey Leith Ross,

    Thanks a lot. You didn't know I wanted it dynamically, because I forgot to mention that small major detail . Seems to happen a lot with me, in my advancing years. Many Thanks and have a good day.

    See ya,

    Dean

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1