+ Reply to Thread
Results 1 to 13 of 13

Offset text in merged cell

  1. #1
    Forum Contributor
    Join Date
    04-16-2014
    Location
    Witbank, SA
    MS-Off Ver
    Excel 2013
    Posts
    268

    Offset text in merged cell

    Hi,

    I am struggling to "shift" text which are in a merged cell. The merged cell ranges from A1 to A3. I know I can centre-, left- or right-align text with vba, however I need to actually move the text into a different position which could be slightly more to the left or to the right from center position. Any help would be greatly appreciated!. Thanx a million!!

    BURAN--Thanx a million!!..your idea worked!!!
    Last edited by juriemagic; 10-15-2014 at 10:55 AM.

  2. #2
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: Offset text in merged cell

    Try adding some spaces after text. It will center the text with the spaces also.
    .. and don't forget to have fun!
    Bogdan.

    mark SOLVED and Add Reputation if my answer pleases you

  3. #3
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Offset text in merged cell

    Using spaces is really bad idea.
    check range.InsertIndent property and also Range.IndentLevel property
    If you are pleased with a member's answer then use the Star icon to rate it.

  4. #4
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: Offset text in merged cell

    No, using merged cells and VBA is a really bad ideea. Spaces does't include VBA.

  5. #5
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Offset text in merged cell

    what I mean is using spaces to align cell content, regardless the VBA. Period.
    I more or less agree regarding merged cells and VBA.

  6. #6
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: Offset text in merged cell

    naah, it's fast and easy and does the job.

  7. #7
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Offset text in merged cell

    And sooner than later will bite you back when try to compare/search/replace/whatever in that cell content

  8. #8
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: Offset text in merged cell

    I for one would try to avoid merging cells but if the situation asks, there's always TRIM function helping to compare/search/replace/whatever in that cell content...

  9. #9
    Forum Expert
    Join Date
    06-25-2009
    Location
    Sofia, Bulgaria, EU
    MS-Off Ver
    Excel 2003-2013
    Posts
    1,290

    Re: Offset text in merged cell

    Quote Originally Posted by bulina2k View Post
    I for one would try to avoid merging cells but if the situation asks, there's always TRIM function helping to compare/search/replace/whatever in that cell content...
    I already said I more or less agree on avoiding merged cells. However that's the other user's decision and it's not the point in that thread. Nobody asks about that.
    If you don't see or pretend that you don't see the problem with with adding spaces to align cell content - good luck, feel free to use Trim, LTrim, RTrim as much as you wish in your code and have fun maintaining it.

  10. #10
    Forum Contributor
    Join Date
    04-16-2014
    Location
    Witbank, SA
    MS-Off Ver
    Excel 2013
    Posts
    268

    Re: Offset text in merged cell

    Hi Buran,

    I just wanted to let you know that the reason I needed EXACTLY what you gave me, is because the text in this cell needs to "shift" or glide inside this merged cell as different situations come up which will make other macro buttons become visible, and as a result will then cover the text. so the text needs to glide to the left..then later when the buttons are invisible and transparency is 1, the text needs to glide again back to the right.

    thanx for your help..i really appreciated it...

  11. #11
    Valued Forum Contributor bulina2k's Avatar
    Join Date
    11-20-2012
    Location
    Urziceni, Ialomita, Romania
    MS-Off Ver
    2019 and 365
    Posts
    867

    Re: Offset text in merged cell

    THAT makes much more sense now!

  12. #12
    Forum Contributor
    Join Date
    04-16-2014
    Location
    Witbank, SA
    MS-Off Ver
    Excel 2013
    Posts
    268

    Re: Offset text in merged cell

    yep..my apologies...

    I normally just say what I need to happen, and don't normally go into a lot of detail...but maybe this was a learning curve for me...BE SPECIFIC!! http://www.excelforum.com/images/smilies/smile.gif

  13. #13
    Forum Contributor
    Join Date
    04-16-2014
    Location
    Witbank, SA
    MS-Off Ver
    Excel 2013
    Posts
    268

    Re: Offset text in merged cell

    yep..my apologies...

    I normally just say what I need to happen, and don't normally go into a lot of detail...but maybe this was a learning curve for me...BE SPECIFIC!!

+ 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. Select a Range of Cells Offset from a Selected Merged cell
    By kelvomatic in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-07-2013, 05:52 PM
  2. How can get offset() from a merged cell.
    By foxguy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-20-2010, 04:57 PM
  3. Coding for offset cell references with multiple row headings with merged cells
    By AndyE in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-04-2010, 02:22 PM
  4. [SOLVED] merged cells into one text cell, size varies dependant on text dat
    By Jazzylady825 in forum Excel General
    Replies: 0
    Last Post: 12-09-2005, 04:30 PM
  5. Replies: 3
    Last Post: 07-09-2005, 05:05 AM

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