Running macro on data input

Joined
Apr 7, 2008
Messages
1
Reaction score
0
I have searched the internet endlessly and have failed to find a solution that works. For starters I don't have much knowledge of visual basic at all, but I'd pick the idea up fairly quickly.

Anyway my problem is this...I'm working on a spreadsheet for a college project and I have created a macro which displays or hides certain rows on a worksheet depending on their content. However, the content of these cells (in the range H22:H102) are also determined by the content of a cell on another worksheet. So basically, what I want is for this macro to be executed everytime a piece of information is entered into the range of cells on the first worksheet ( in my case G24:G104). The macro I have for hiding the rows is as follows:

Sub HideRows2()
Dim cell As Range
For Each cell In Range("H22:H102")
If UCase(cell.Value) = "OK" Then
cell.EntireRow.Hidden = True
Else: cell.EntireRow.Hidden = False
End If
Next
End Sub

I hope I have made myself understood and any help is very much appreciated.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top