+ Reply to Thread
Results 1 to 8 of 8

[SOLVED] VBA Changing button.caption in a specific cell column

  1. #1
    Registered User
    Join Date
    07-17-2013
    Location
    Quezon City
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    75

    [SOLVED] VBA Changing button.caption in a specific cell column

    I have a problem about cell through buttons.

    SITUATION:
    I have a table and a button in my worksheet.

    MACRO:
    If I doubleclick a cell it will put "CHECK" so on and so for... then I have a button that will entire column will be "CHECK" where ever the button is place in which column.

    THE PROBLEM IS: - please help
    I want to change the BUTTON.caption when a user ERASE at least only 1 "CHECK" in the table then the button CHANGE name also.

    Flow:
    If x = x Then

    button.caption = "uncheck all"

    Else

    button.caption = "check all"

    End If

    WHY I WANT THAT:
    Because to inform the user that there is UNCHECK MARK in the column of the table. They will notice that a BUTTON.caption change.

    PLEASE SEE ATTACHMENT BELOW:
    SampleProblem.xlsb
    Last edited by mcmunoz; 09-26-2013 at 09:15 PM.

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: VBA Changing button.caption in a specific cell column

    Try this as a worksheet_chang event. Make sure your button names correspond with the column (so "button 1" in column 1, "button 3" in column 3 etc.):

    Please Login or Register  to view this content.
    Please click the * below if this helps
    Please click the * below if this helps

  3. #3
    Registered User
    Join Date
    07-17-2013
    Location
    Quezon City
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    75

    Re: VBA Changing button.caption in a specific cell column

    MINION

    Its working. Wait
    Last edited by mcmunoz; 09-25-2013 at 04:34 AM. Reason: Mistaken

  4. #4
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: VBA Changing button.caption in a specific cell column

    As below.
    Sample 8.xls
    Just so to set your expectations straight, this does NOT:
    If I doubleclick a cell it will put "CHECK" so on and so for... then I have a button that will entire column will be "CHECK" where ever the button is place in which column.
    It does change the button caption - because that's what you asked

    Please remember to click the * below if this helps

  5. #5
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: VBA Changing button.caption in a specific cell column

    I attached the wrong sample...
    See the right one below

    SampleProblem.xlsb

  6. #6
    Registered User
    Join Date
    07-17-2013
    Location
    Quezon City
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    75

    Re: VBA Changing button.caption in a specific cell column

    Quote Originally Posted by JasperD View Post
    I attached the wrong sample...
    See the right one below

    Attachment 267508
    Sorry Jasper, I am late to response again. I just re-edit my reply since it is working. But I seen a problem.

    This is the problem, because when ever I type and edit other cell. There is a MsgBox says "The Item with the specific name wasn't found". And I seen it is limited to check the rows of the table, when ever I add another row again, it is not working and MsgBox is always popping.

    This is the file with my code and your code: EDITED
    SampleSample.xlsb
    Last edited by mcmunoz; 09-25-2013 at 05:07 AM. Reason: Wrong File

  7. #7
    Registered User
    Join Date
    07-17-2013
    Location
    Quezon City
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    75

    Re: VBA Changing button.caption in a specific cell column

    Is this problem possible to limit the macro into the table and to the buttons?

    Is this possible the WorkSheet_Change macro will be limited in the TABLE only.
    Last edited by mcmunoz; 09-25-2013 at 10:59 PM.

  8. #8
    Registered User
    Join Date
    07-17-2013
    Location
    Quezon City
    MS-Off Ver
    Excel 2010 and 2013
    Posts
    75

    Re: VBA Changing button.caption in a specific cell column

    Thank you Jasper for your help. I learned something on you.

    I use your code: ActiveSheet.Shapes([Button.Name]).Select: Selection.Characters.Text = "": Target.Activate

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Changing the Caption of an Option button in a userform using vba
    By newbi004 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-10-2012, 12:11 PM
  2. [SOLVED] Is it possible to do a comm.button with scrolling caption /changing caption?
    By Lkivagten in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-06-2012, 08:10 AM
  3. Changing Command Button Caption with userform Open
    By andrew c. in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-06-2011, 08:09 PM
  4. Changing the caption of a Command Button
    By Colin M in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-02-2007, 12:24 PM
  5. changing the caption of a command button
    By JWCrosby in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-08-2005, 04:15 PM

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