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

UHsoccer

Well-known Member
Joined
Apr 3, 2002
Messages
1,023
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 ?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
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.
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top