Columns doesnt return expected results

  • Thread starter Thread starter Roger Smith
  • Start date Start date
R

Roger Smith

I hope this isnt too much of a newbie question... its been years since I
last did any serious VB programming.

I have a body of code that has just finished working with a range of rows
set by:

Rows(4 & ":" & intLastRow).Select ' select all active rows

and now I want to format column A. So I try setting column A to be the
active and selected column with

Columns("A:A").Select ' select column A

however it returns a range of Columns("A:U"). I have also tried
Columns(1).Select and
Range("A:A").activate with the same results.


What am I doing wrong here?

Thanks much
 
Do you have those bleeping merged cells in column A to column U?

They can screw up lots of things.

And to make matters worse, each version of excel seems to treat merged cells
differently.
 
Thanks Dave - you nailed it... way down deep in the report there was a
section where A to U was merged. Much thanks to you and a warning to fellow
programmers... those merged cells can indeed really screw things up like
crazy and yield results that, at first glance, seem to be way out of line
with the intended action.

Cheers,
 
Merged Cells.................the best thing to come along since the Edsel


Gord Dibben MS Excel MVP

Thanks Dave - you nailed it... way down deep in the report there was a
section where A to U was merged. Much thanks to you and a warning to fellow
programmers... those merged cells can indeed really screw things up like
crazy and yield results that, at first glance, seem to be way out of line
with the intended action.

Cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top