Solved

Selective Display Of Cells In Excel

Posted on 2002-05-23
5
199 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

732 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