PC Review


Reply
Thread Tools Rate Thread

Cannot select single column to the left of freeze

 
 
=?Utf-8?B?QWtl?=
Guest
Posts: n/a
 
      22nd Oct 2006

In Excel 2003 in XP I have a sheet with column E:E frozen. (Works fine)

In a macro I then try to select A:A for modification - it turns out that no
matter what, or how (?) I try to mark columns to the left of the freeze- it
automatically extends to include the freeze column.
Thus Range("A:A").Select marks columns A:E, and B:C marks columns B:E and
so forth...

I included an unfreeze in the macro, which helped for a while. But now I
still get the frozen behaviour (and I have verified that the sheet is in fact
both unlocked and unfrozen).

Can someone pls explain what is happening. Is there a workaround?

Kind regards / Ake
 
Reply With Quote
 
 
 
 
Bob Phillips
Guest
Posts: n/a
 
      22nd Oct 2006
Freeze? What do you mean? Not a term I know.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Ake" <(E-Mail Removed)> wrote in message
news:AFEDC51A-C887-4573-AAB7-(E-Mail Removed)...
>
> In Excel 2003 in XP I have a sheet with column E:E frozen. (Works fine)
>
> In a macro I then try to select A:A for modification - it turns out that

no
> matter what, or how (?) I try to mark columns to the left of the freeze-

it
> automatically extends to include the freeze column.
> Thus Range("A:A").Select marks columns A:E, and B:C marks columns B:E and
> so forth...
>
> I included an unfreeze in the macro, which helped for a while. But now I
> still get the frozen behaviour (and I have verified that the sheet is in

fact
> both unlocked and unfrozen).
>
> Can someone pls explain what is happening. Is there a workaround?
>
> Kind regards / Ake



 
Reply With Quote
 
Tom Ogilvy
Guest
Posts: n/a
 
      22nd Oct 2006
I couldn't reproduce the behavior. Did freeze panes with column F selected.
I then had no problem selection A:A whether the were frozen visible or not
visible.

Perhaps you have a row or more that has merged cells across A to E.

Excel 2003, Windows XP
--
Regards,
Tom Ogilvy

"Ake" <(E-Mail Removed)> wrote in message
news:AFEDC51A-C887-4573-AAB7-(E-Mail Removed)...
>
> In Excel 2003 in XP I have a sheet with column E:E frozen. (Works fine)
>
> In a macro I then try to select A:A for modification - it turns out that
> no
> matter what, or how (?) I try to mark columns to the left of the freeze-
> it
> automatically extends to include the freeze column.
> Thus Range("A:A").Select marks columns A:E, and B:C marks columns B:E and
> so forth...
>
> I included an unfreeze in the macro, which helped for a while. But now I
> still get the frozen behaviour (and I have verified that the sheet is in
> fact
> both unlocked and unfrozen).
>
> Can someone pls explain what is happening. Is there a workaround?
>
> Kind regards / Ake



 
Reply With Quote
 
=?Utf-8?B?QWtl?=
Guest
Posts: n/a
 
      23rd Oct 2006
"Tom Ogilvy" wrote:

"had no problem selection A:A" - Well,I can also do that- but not
programmatically.

"Perhaps you have a row or more that has merged cells across A to E" - Yes,
you are quite right, this was it. Thanks a lot.

So, I can indeed change the witdh of a single column if I do it by hand,
even if there is a merged cell across the column.

But I cannot change the width of that same single column if I try to do that
from within a macro. Then it always extends the selection to include all
columns of the merged cells. If not a bug, it is at least an inconsistency...

So, the last half of the question still remains- how can I do this
quick-and-dirty column width adjustment without having to know about all
possible merged cells and unmerge/merge them back again, in the macro. (or is
there perhaps a quick-and-dirty way to do that too ;-)

Humbly / Ake

 
Reply With Quote
 
NickHK
Guest
Posts: n/a
 
      24th Oct 2006
Ake,
Not exactly what your problem is, but this works for me:

With Range("A20:E20")
.MergeCells = True
End With
ActiveWindow.SplitColumn = 4
ActiveWindow.FreezePanes = True
Columns("A:A").ColumnWidth = 10

Note, there is no .Select in this code.

NickHK

"Ake" <(E-Mail Removed)> wrote in message
news:9E7F8DF4-AE71-4972-A066-(E-Mail Removed)...
> "Tom Ogilvy" wrote:
>
> "had no problem selection A:A" - Well,I can also do that- but not
> programmatically.
>
> "Perhaps you have a row or more that has merged cells across A to E" -

Yes,
> you are quite right, this was it. Thanks a lot.
>
> So, I can indeed change the witdh of a single column if I do it by hand,
> even if there is a merged cell across the column.
>
> But I cannot change the width of that same single column if I try to do

that
> from within a macro. Then it always extends the selection to include all
> columns of the merged cells. If not a bug, it is at least an

inconsistency...
>
> So, the last half of the question still remains- how can I do this
> quick-and-dirty column width adjustment without having to know about all
> possible merged cells and unmerge/merge them back again, in the macro. (or

is
> there perhaps a quick-and-dirty way to do that too ;-)
>
> Humbly / Ake
>



 
Reply With Quote
 
=?Utf-8?B?QWtl?=
Guest
Posts: n/a
 
      26th Oct 2006
Thanks Nick,

I think this was the workaround I was looking for. I did .select
(or.activate) just from old habits. And obviously that is where the
inconsistency (or bug) shows up.
It does always mark _all_ columns covered by the merge(s) in the column I
selected.

But of course I do not need to .select, just to modify the width of the
column ;-)

Thanks all, case closed / Åke
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Select Case on Single column only Steve Microsoft Excel Programming 1 21st May 2010 07:54 PM
how to select a single column when this column cross a merged cell =?Utf-8?B?Y25FYWdsZQ==?= Microsoft Excel Programming 1 13th Nov 2007 04:49 AM
Single Column select =?Utf-8?B?RGFuaWVsIFEu?= Microsoft Excel Misc 4 18th Oct 2006 10:07 PM
Select column cells to the left/right of active selection - an example aztecbrainsurgeon@yahoo.com Microsoft Excel Programming 1 24th Mar 2005 06:36 PM
Cursor blips to far left column of worksheet after scrolling down in freeze pane Pam Microsoft Excel Misc 0 20th Sep 2003 02:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:53 AM.