I want makro which can find out which cells are empty in area a12:a35 and
hide those rows where cells are empty.
I want makro which can find out which cells are empty in area a12:a35 and
hide those rows where cells are empty.
"Alen32" wrote:
> I want makro which can find out which cells are empty in area a12:a35 and
> hide those rows where cells are empty.
>
>
One way:-
Sub HideRows()
For a = 12 To 35
If Cells(a, 1) = "" Then
Cells(a, 1).Select
Selection.EntireRow.Hidden = True
End If
Next a
End Sub
doesn't work.
"Alen32" wrote:
> doesn't work.
>
>
Should do. I trust you copied the lines into a new module
( Alt+F11>Insert>Module )
it works in some sheets but dosn't work in some others sheets. I don't know
why
Depends on whether the cells are empty or contain a space, I guess
how to remove space?
Sub HideRows()
Dim cell as String
Dim a as Long
For a = 12 To 35
cell = Application.Substitute(Cells(a,1).Text,chr(160),"")
If Trim(cell) = "" Then
Cells(a, 1).EntireRow.Hidden = True
End If
Next a
End Sub
--
Regards,
Tom Ogilvy
"Alen32" <[email protected]> wrote in message
news:[email protected]...
> how to remove space?
>
thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks