Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
sorting two columns of merged cells | Excel Discussion (Misc queries) | |||
Locate merged cells to sort on 3 columns | Excel Worksheet Functions | |||
hiding columns with merged rows | Excel Discussion (Misc queries) | |||
Selecting & Formatting Columns w/ Merged Cells | New Users to Excel | |||
Sort columns containing merged cells. | Excel Discussion (Misc queries) |