Macro to hide rows not working
Bob,
Have bought my books.....
One thing I need to know quickly...is it possible to "hide" the macro code
from others. I'm now using the above code that you helped me with, but
already people in my staff are messing around with it! I'd like to hide it
from view to avoid this temptation! Any suggestions please?
Al
"Bob Phillips" wrote:
Al,
I would suggest 3 things.
First, get yourself a reasonably ambitious mid-sized project that will
actually be useful to you. Something like a building a home accounts
application. Work out what it needs to do, the inputs and outputs and
document that in some for.
Get a good VBA book. John Walkenbach's are usually reliable, VBA for Dummies
or some other title. Go to a decent bookstore, browse and see who writes in
a style that you are comfortable with.
Then develop it. Read some of the book, practice the techniques. Then break
your earlier design down into chunks, say one for inputting cheques, one for
standing orders, and use what you have learned to develop those chunks.If
you get stuck, dive into the book, or come visit us again. Then move on to
the next chunk etc.
You will soon improve.
--
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my addy)
"Al" wrote in message
...
Bob, many thanks. I'll give this one a go first thing in the morning once
I'm
back in the office.
Can you advise me a good place to start learning all this "VBA macro
stuff"?!
Al
"Bob Phillips" wrote:
I thought that was how you wanted it Al <g.
Try
Sub hide_row()
For Each cell In Range("B6:B9")
cell.EntireRow.Hidden = cell.Value < 1
Next cell
End Sub
--
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my
addy)
"Al" wrote in message
...
Bob, this seems to work for cells B6 and B9 only...but not the range.
i.e.
I
also have B7<1, but this row is not hidden.
Thanks for your help!
"Bob Phillips" wrote:
Too many dots
Sub hide_row()
For Each cell In Range("B6,B9")
cell.EntireRow.Hidden = cell.Value < 1
Next cell
End Sub
--
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in my
addy)
"Bob Phillips" wrote in message
...
Sub hide_row()
For Each cell In Range("B6,B9")
cell.EntireRow.Hidden = cell..Value < 1
Next cell
End Sub
--
---
HTH
Bob
(there's no email, no snail mail, but somewhere should be gmail in
my
addy)
"Al" wrote in message
...
What I'm trying to achieve is the automatic hiding of entire rows
if
the
value of a cell, in this case in column B, is < 1. The below
example
works...row 6 is hidden.
Sub hide_row()
If Range("B6").Value < 1 Then Range("B6").EntireRow.Hidden = True
End Sub
But when I try to impose this upon a range of column B, then, alas,
not
the
desired result!
If Range("B6,B9").Value < 1 Then Range("B6,B9").EntireRow.Hidden =
True
Can anyone point me in the right direction? Thanks in advance!
Al
|