Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: VB Select("A:A") selects A:H due to merged columns

  1. #1
    Board Regular
    Join Date
    Apr 2002
    Location
    South Bend, IN
    Posts
    991
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    When I do a select A:A in VB and there are some columns that were merged, I end up selecting too much.
    How can I restrict the select to the "original" A:A ?

  2. #2
    MrExcel MVP Damon Ostrander's Avatar
    Join Date
    Feb 2002
    Location
    Denver, Colorado USA
    Posts
    4,239
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi UHsoccer,

    You can't make Excel display, select or operate on only part of a cell. Once cells are merged they effectively become one cell in this sense. In order to get Excel to select just part of a merged cell that is in column A, you must first unmerge the cell. If you are trying to do this via a macro, I suggest you just add code to unmerge all the merged cells that fall both inside and outside of the column A, perform your desired operation on column A, then re-merge the cells. This can all be done in VBA. Just be aware that any operation you perform on the contents of any part (sub-cell) of a merged cell only "takes" if it is performed on the first (top left) cell in the range.
    Keep Excelling.

    Damon

    VBAexpert Excel Consulting
    LinkedIn Profile http://www.linkedin.com/pub/damon-ostrander/7/79/a93
    AllExperts Profile http://www.allexperts.com/ep/1059-30...-Ostrander.htm

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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