Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Adding Columns in Excel 2007 (2003 Compatibility Mode)

both Please advise,

I am trying to add columns as per the following code:

Columns("B:B").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove

When i check the worksheet, columns A and B have been selected,

If I run the following code:

Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove

only Column C is selected.

Can anyone help?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Adding Columns in Excel 2007 (2003 Compatibility Mode)

I didn't start xl2007, but different versions of excel treat merged cells
differently.

Do you have any cells in A:B that are merged?

AndyJ wrote:

both Please advise,

I am trying to add columns as per the following code:

Columns("B:B").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove

When i check the worksheet, columns A and B have been selected,

If I run the following code:

Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove

only Column C is selected.

Can anyone help?


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Adding Columns in Excel 2007 (2003 Compatibility Mode)

Cheers Dave,

I didnt consider that!.

I have been writing in VB.NET and not VBA for the last couple of years and
have forgotten some simple checks.

Thanks for your help.


"Dave Peterson" wrote:

I didn't start xl2007, but different versions of excel treat merged cells
differently.

Do you have any cells in A:B that are merged?

AndyJ wrote:

both Please advise,

I am trying to add columns as per the following code:

Columns("B:B").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove

When i check the worksheet, columns A and B have been selected,

If I run the following code:

Columns("C:C").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove

only Column C is selected.

Can anyone help?


--

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
How can I turn off compatibility mode in Excel 2007? HaJiggity Excel Discussion (Misc queries) 14 April 30th 23 11:41 AM
Excel 2007 Compatibility Mode Marsh New Users to Excel 1 February 26th 10 05:48 PM
Excel 2007 Compatibility Mode Not Responding Tim Malle Excel Discussion (Misc queries) 0 February 19th 09 11:52 PM
Compatibility Mode to Excel 2007 Jennifer Excel Worksheet Functions 4 September 16th 08 05:49 PM
Excel 2007 always opens in Compatibility Mode ksmek Excel Discussion (Misc queries) 6 December 21st 07 08:11 PM


All times are GMT +1. The time now is 04:35 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"