Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Hiding a column if a cell has an X

I have two sheets in my file.

Here is what I need to do:

If a box in sheet1 has an "x" I want a column (sometimes 2 or 3
columns) on sheet2 to automatically hide.

Thank you for your help.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 621
Default Hiding a column if a cell has an X

What is a "box" and how does the "x" get into that box?

Assume your subject is correct and you mean "cell", you could use some
event code to do the job.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo stoppit
Application.EnableEvents = False
If Target.Address = "$A$2" And Target.Value = "x" Then
Sheets("Sheet2").Range("A:A").EntireColumn.Hidden = True
End If
stoppit:
Application.EnableEvents = True
End Sub


Gord

On Fri, 10 Feb 2012 10:44:00 -0800 (PST), tr2yhb
wrote:

I have two sheets in my file.

Here is what I need to do:

If a box in sheet1 has an "x" I want a column (sometimes 2 or 3
columns) on sheet2 to automatically hide.

Thank you for your help.

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
hiding row if the cell is found in a differeent column Ivan Excel Programming 0 February 24th 10 04:00 PM
Hiding all rows where the cell value in column 13 of same row = $0.00 [email protected] Excel Programming 1 May 24th 07 07:28 AM
Hiding all rows where the cell value in column 13 of same row = $0.00 [email protected] Excel Programming 1 May 24th 07 02:17 AM
Hiding column if cell in previous column is empty-revised [email protected] Excel Programming 2 January 4th 07 06:45 AM
autoamtically hiding a column after moving to a next cell outside Frederic Excel Programming 2 June 4th 05 04:25 PM


All times are GMT +1. The time now is 08:25 PM.

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

About Us

"It's about Microsoft Excel"