Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Hiding Columns with Merged Cells

I would like to include instructions in a macro to hide a column.
Part of the column contains merged cells.
When I record a macro for the process I want, the instructions read:

Columns("D:D").Select
Selection.EntireColumn.Hidden = True

However, when these instructions are incorporated into my macro both columns
D and E (due to the merged cells) are hidden.

Any help would be appreciated.
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default Hiding Columns with Merged Cells


Unmerge the cells and then hide the column.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware


"Steve Pollack"
wrote in message
I would like to include instructions in a macro to hide a column.
Part of the column contains merged cells.
When I record a macro for the process I want, the instructions read:

Columns("D:D").Select
Selection.EntireColumn.Hidden = True

However, when these instructions are incorporated into my macro both columns
D and E (due to the merged cells) are hidden.

Any help would be appreciated.
Thanks.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Hiding Columns with Merged Cells

It is the Select method that is causing you the problem.
Shorten the code by taking out the .Select and it will work fine -

Columns("D:D").EntireColumn.Hidden = True

Hope this helps

Mark


"Steve Pollack" wrote:

I would like to include instructions in a macro to hide a column.
Part of the column contains merged cells.
When I record a macro for the process I want, the instructions read:

Columns("D:D").Select
Selection.EntireColumn.Hidden = True

However, when these instructions are incorporated into my macro both columns
D and E (due to the merged cells) are hidden.

Any help would be appreciated.
Thanks.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 213
Default Hiding Columns with Merged Cells

Mark,

I've taken your advice about the .Select but am still having problems.
Below is a snippet of my code. Please advise if there is anything I can do
to correct this.

Thanks!

Randy

Select Case ProjectSize
Case Is = "s"
Columns("G:H").EntireColumn.Hidden = True

"Mark Dullingham" wrote:

It is the Select method that is causing you the problem.
Shorten the code by taking out the .Select and it will work fine -

Columns("D:D").EntireColumn.Hidden = True

Hope this helps

Mark


"Steve Pollack" wrote:

I would like to include instructions in a macro to hide a column.
Part of the column contains merged cells.
When I record a macro for the process I want, the instructions read:

Columns("D:D").Select
Selection.EntireColumn.Hidden = True

However, when these instructions are incorporated into my macro both columns
D and E (due to the merged cells) are hidden.

Any help would be appreciated.
Thanks.

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
sorting two columns of merged cells bigjim Excel Discussion (Misc queries) 2 April 3rd 10 09:05 PM
Locate merged cells to sort on 3 columns Rob B Excel Worksheet Functions 2 October 27th 09 04:49 PM
hiding columns with merged rows Cormac Excel Discussion (Misc queries) 3 June 5th 08 01:29 PM
Selecting & Formatting Columns w/ Merged Cells Lisa Beach New Users to Excel 2 October 10th 05 10:19 PM
Sort columns containing merged cells. Ron Excel Discussion (Misc queries) 1 May 4th 05 01:08 PM


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