ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   EntireColumn and merged cells (https://www.excelbanter.com/excel-programming/326197-entirecolumn-merged-cells.html)

OkieViking

EntireColumn and merged cells
 
I am trying to select the entire column of the active cell (say it is C4).
In row 1 and row 2 there are several merged cells (say B1:G1 and B2:G2).

Range("C4").Activate
ActiveCell.EntireColumn.Select
' Where C4 is a cell found with a Find command

When I do this, all the columns containing the merged cells get selected,
not just the one I want to select. How can I bypass this problem?

Duke Carey[_2_]

EntireColumn and merged cells
 
One of the classic reasons for not EVER, EVER, EVER merging cells.

It's far better to unmerge your cells and then use Center Across Selection
as the horizontal format. Then your column selection will work fine.


"OkieViking" wrote in message
...
I am trying to select the entire column of the active cell (say it is C4).
In row 1 and row 2 there are several merged cells (say B1:G1 and B2:G2).

Range("C4").Activate
ActiveCell.EntireColumn.Select
' Where C4 is a cell found with a Find command

When I do this, all the columns containing the merged cells get selected,
not just the one I want to select. How can I bypass this problem?




OkieViking

EntireColumn and merged cells
 
I agree, but the input spreadsheet is not under my control. I am stuck with
the merged cells.

"Duke Carey" wrote:

One of the classic reasons for not EVER, EVER, EVER merging cells.

It's far better to unmerge your cells and then use Center Across Selection
as the horizontal format. Then your column selection will work fine.


"OkieViking" wrote in message
...
I am trying to select the entire column of the active cell (say it is C4).
In row 1 and row 2 there are several merged cells (say B1:G1 and B2:G2).

Range("C4").Activate
ActiveCell.EntireColumn.Select
' Where C4 is a cell found with a Find command

When I do this, all the columns containing the merged cells get selected,
not just the one I want to select. How can I bypass this problem?





Duke Carey[_2_]

EntireColumn and merged cells
 
Okie -

I've not had to fight my way through your problem. There are routines that
you can find by googling the newsgroup that will allow you to find and
unmerge cells. Perhaps you can adapt one of those to:

1) identify & log any merged cells that cross your column
2) unmerge them while your routine runs
3) re-merges them afterwards

You'd need to run it only when the selected column count 1, right?

Alternatively, you can modify it to convert all merged cells into Center
Across Selection and then advocate to whmever has dominion over the input
sheet that it stay that way.

My 2 cents worth is that I wish Microsoft had made merging cells really
difficult and had made the center across selection a toolbar default.


"OkieViking" wrote in message
...
I agree, but the input spreadsheet is not under my control. I am stuck
with
the merged cells.

"Duke Carey" wrote:

One of the classic reasons for not EVER, EVER, EVER merging cells.

It's far better to unmerge your cells and then use Center Across
Selection
as the horizontal format. Then your column selection will work fine.


"OkieViking" wrote in message
...
I am trying to select the entire column of the active cell (say it is
C4).
In row 1 and row 2 there are several merged cells (say B1:G1 and
B2:G2).

Range("C4").Activate
ActiveCell.EntireColumn.Select
' Where C4 is a cell found with a Find command

When I do this, all the columns containing the merged cells get
selected,
not just the one I want to select. How can I bypass this problem?







OkieViking

EntireColumn and merged cells
 
Thanks

"Duke Carey" wrote:

Okie -

I've not had to fight my way through your problem. There are routines that
you can find by googling the newsgroup that will allow you to find and
unmerge cells. Perhaps you can adapt one of those to:

1) identify & log any merged cells that cross your column
2) unmerge them while your routine runs
3) re-merges them afterwards

You'd need to run it only when the selected column count 1, right?

Alternatively, you can modify it to convert all merged cells into Center
Across Selection and then advocate to whmever has dominion over the input
sheet that it stay that way.

My 2 cents worth is that I wish Microsoft had made merging cells really
difficult and had made the center across selection a toolbar default.


"OkieViking" wrote in message
...
I agree, but the input spreadsheet is not under my control. I am stuck
with
the merged cells.

"Duke Carey" wrote:

One of the classic reasons for not EVER, EVER, EVER merging cells.

It's far better to unmerge your cells and then use Center Across
Selection
as the horizontal format. Then your column selection will work fine.


"OkieViking" wrote in message
...
I am trying to select the entire column of the active cell (say it is
C4).
In row 1 and row 2 there are several merged cells (say B1:G1 and
B2:G2).

Range("C4").Activate
ActiveCell.EntireColumn.Select
' Where C4 is a cell found with a Find command

When I do this, all the columns containing the merged cells get
selected,
not just the one I want to select. How can I bypass this problem?








All times are GMT +1. The time now is 07:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com