Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Columns doesnt return expected results

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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 411
Default Columns doesnt return expected results

Try
Columns("A:A").NumberFormat = "General"

instead of

Columns("A:A").Select
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Columns doesnt return expected results

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.

Roger Smith wrote:

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


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Columns doesnt return expected results

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,

"Dave Peterson" wrote in message
...
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.

Roger Smith wrote:

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


--

Dave Peterson



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default Columns doesnt return expected results

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


Gord Dibben MS Excel MVP

On Sat, 22 Mar 2008 15:26:36 -0700, "Roger Smith"
wrote:

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,

"Dave Peterson" wrote in message
...
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.

Roger Smith wrote:

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


--

Dave Peterson



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
V lookup with 2 criteria to return results for multiple columns JenL Excel Worksheet Functions 2 September 20th 07 10:04 PM
Sumproduct not returning expected results Dos Equis Excel Worksheet Functions 8 January 4th 07 04:12 PM
Round doesnt work the way it is expected Carlo Excel Discussion (Misc queries) 13 December 20th 06 11:26 PM
Paste results not as expected Barbar Excel Programming 4 November 9th 06 01:20 AM
I need to return mulitple results in several columns please help Jerry Excel Discussion (Misc queries) 0 March 13th 06 10:46 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"