detect cell value

C

crapit

Wat do I use to detect cell contain the word "Actual" and assign the row to
a variable which I can use latter on?
 
F

Frank Kabel

Hi
you may explain with some more detail what you mean with 'variable
assignment' and what you want to do later on
 
F

Frank Kabel

Hi
try the following macro:
Sub hide_rows()
Dim lastrow As Long
Dim row_index As Long
Application.ScreenUpdating = False
lastrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For row_index = lastrow - 1 To 1 Step -1
If Cells(row_index, 1).Value="Actual" then
rows(row_index).hidden=true
End If
Next
Application.ScreenUpdating = True
End Sub
 
F

Frank Kabel

Hi
what do you men with does not work?
This searches for the value 'Actual' in column A and works for me
 
C

crapit

I get wat you mean, but only cell A1 can be detected, but i have quite a
number of cell that contain "Actual"
 
F

Frank Kabel

Hi
now I'm confused?. The code should run through column A and hide all
rows which have the text 'Actual' in column A. If this is NOT what you
want please describe with more detail what you expect
 
C

crapit

I cant due to confidential purposes. Anyway, does ur macro refer to column
'A' only?
 
C

crapit

Anyway, I had roughly figure out how it work! How do I calculate the total
no, of worksheets in a workbook?
 
Top