Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default hide one column skip two column and unhide one of 11

Here is what the code you posted does:
Line 1 - Selects entire sheet
Line 2 - Unhide all columns
Line 3 - Move pointer to cell D5
Line 4 - Move pointer to cell A8
Lines 5 & 6 - Move pointer to right on same row two times
Line 7 - Move pointer to cell E9
Line 8 - Hide Column E
Line 9 - Move pointer to cell A8
Lines 10 & 11 - Moves pointer to right two times
Line 12 - Moves pointer to cell I9
Line 13 - Selects all contiguous cells with data to right of cell I9
Line 14 - Selects cells I thru R on row 9
Line 15 - Hides columns I thru R
Line 16 - Moves pointer to cell A8
Line 17 - Ends Sub

You could delete lines 3 thru 6,
9 thru 11 and 13 and accomplish
the same result, which is to hide
column E and Columns I thru r.
since I have no idea what your sheet
layout is, I can't offer any advice on
how to fix your other problem.

"Budyza" wrote:

I have a report of 14 months data. during a review meeting we use current
month plus two previous months.
previous previous current hidden hidden hidden
hidden
NOVEMBER DECEMBER JANUARY FEBRUARY MARCH APRIL ect... DECEMBER

Currently I show Nov dec and Jan I created a macro to hide nov and unhide
Feb. it works great. when I push the button again it does not go over another
column. here is the code I used. it keeps going to the column in the macro no
the first open space.
HOME is Column A row 8 and is the first row I have a data entry point above
that is titles and notes.

Cells.Select
Selection.EntireColumn.Hidden = False
Range("D5").Select
Application.Goto Reference:="Home"
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("E9").Select
Selection.EntireColumn.Hidden = True
Application.Goto Reference:="Home"
Selection.End(xlToRight).Select
Selection.End(xlToRight).Select
Range("I9").Select
Range(Selection, Selection.End(xlToRight)).Select
Range("I9:R9").Select
Selection.EntireColumn.Hidden = True
Application.Goto Reference:="Home"
End Sub


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 do I set up a column tool to hide/unhide? pufimic Excel Discussion (Misc queries) 1 October 27th 06 01:26 AM
Check Box Macro to hide and unhide a column Daphne Excel Worksheet Functions 9 June 26th 06 01:50 PM
VBA to hide a column and unhide it Frederic Excel Programming 3 July 1st 05 03:22 PM
Hide / unhide column in VBA Patrick Excel Programming 2 November 18th 04 06:03 PM
Macro that will always hide / unhide next column Kirby[_3_] Excel Programming 2 June 7th 04 10:21 PM


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