+ Reply to Thread
Results 1 to 5 of 5

text alignment in command button in excel (vba)

  1. #1
    Registered User
    Join Date
    03-30-2010
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    3

    Question text alignment in command button in excel (vba)

    Hi,

    Is there any way i can change the alignment of command button to left in excel. I am using activex button and in properties i don't see any text alignment option.

    Thanks in advance.
    addy

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,288

    Re: text alignment in command button in excel (vba)

    That's because there isn't one. Do you actually need to use an ActiveX one rather than a Forms one?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    03-30-2010
    Location
    Ireland
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: text alignment in command button in excel (vba)

    Yes i'm using Activex Command Button because I need to set background color and i think Form Button won't let me. Correct me if i'm wrong...

    Thanks

  4. #4
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,288

    Re: text alignment in command button in excel (vba)

    No, that's pretty much correct. Forms controls are more stable though. You could try using a shape and assign a macro to that?

  5. #5
    Registered User
    Join Date
    08-30-2020
    Location
    Europe
    MS-Off Ver
    Office 365
    Posts
    2

    Re: text alignment in command button in excel (vba)

    Unfortunately, there is no setting to determine the alignment of command button text.
    A possible workaround is to add as many whitespaces behind your button text (and a final ordinary character, e.g. a dot) that the text gets longer than the button width. In this case, the beginning of your button text will be left-aligned.

+ 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