Solved

Selective Display Of Cells In Excel

Posted on 2002-05-23
5
196 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
  • 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

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…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

790 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