Solved

Selective Display Of Cells In Excel

Posted on 2002-05-23
5
198 Views
Last Modified: 2010-05-18
Hi,

I have a problem with Excel.

I have a spreadsheet which has an Auto_Open module which selectivly hides or unhides cells dependant on the user.  However I now need to unhide a cell based on what the user enters into another cell...it breaks down thus...

X4 is hidden but when B4>0 I want to unhide it.

Is there a cell event change event in Excel VBA that I can tap into to do this?
0
Comment
Question by:WHITER99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 44

Accepted Solution

by:
bruintje earned 100 total points
ID: 7029988
Hi, WHITER99

-in excel open the VB editor (ALT+F11)
-then double click the ThisWorkBook icon
-paste the code

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
  If Target.Address = "$B$4" Then
    If Target.Value > 0 Then
      Columns("Z:Z").Select
      Selection.EntireColumn.Hidden = False
    End If
  End If
End Sub

-this will make the complete column Z visible
-you can't hide or unhide one cell only columns

HTH:O)Bruintje
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 7030079
bruintje:

I take it you've had lots of experience w/ Excel Object Library ;) (you answer all of the excel questions first!)

0
 
LVL 44

Expert Comment

by:bruintje
ID: 7030189
Hi bobbit31, i like them more then picking some API calls or doing some ASP stuff like i do for my job ;)
0
 

Author Comment

by:WHITER99
ID: 7031378
Thanks,

It was much easier than I thought it would be but then it always is when somebidy gives you the answer.

Thanks again.
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7031404
Hi WHITER99, i guess the autograde made it a B?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question