Hello and Help!
Using this macro for column a with values at "NIU" but my data spans d5:ey485 and should really be for values shown as 0. would appreciate anyone's help. Thanks!
Please Login or Register to view this content.
Hello and Help!
Using this macro for column a with values at "NIU" but my data spans d5:ey485 and should really be for values shown as 0. would appreciate anyone's help. Thanks!
Please Login or Register to view this content.
Last edited by jeffreybrown; 10-08-2012 at 10:25 AM. Reason: Please use code tags when posting code...Thanks.
Your macro is hidding the entirerow if it finds "NIU" in column "A" only. In which columns/ rows do you see "NIU" ?
Please Login or Register to view this content.
Right now the Macro is working correctly, however I'd like to expand the macro to find rows within d5:ey485 with the value as 0 instead of looking only in column a for value "niu".
PHP Code:
Sub NValencia()
Dim Rng As Range, hRng As Range, sRng As Range
Dim MyAdd As String
Set Rng = Range([A1], [A999].End(xlUp))
[A1].Resize(Rng.Rows.Count).EntireRow.Hidden = False
Set sRng = Rng.Find("NIU", , xlFormulas, xlWhole)
If sRng Is Nothing Then
MsgBox "Nothing"
Else
MyAdd = sRng.Address
Do
If hRng Is Nothing Then
Set hRng = sRng
Else
Set hRng = Union(hRng, sRng)
End If
Set sRng = Rng.FindNext(sRng)
Loop While Not sRng Is Nothing And sRng.Address <> MyAdd
If Not hRng Is Nothing Then
hRng.EntireRow.Hidden = True
End If
End If
End Sub
It's still looking for "NIU"; How can I change the macro to find rows within d5:ey485 with the value as "0" instead of looking value "niu".
orPlease Login or Register to view this content.
Please Login or Register to view this content.
Last edited by AB33; 10-08-2012 at 01:24 PM.
HiddenRows.JPG
???
Picture1.jpg
Here's what I'm working with. I already have a macro to hide columns, but the macro above isn't hiding rows 6,7,9-18....
I'm so appreciative of everyone's help!!
Please attach a sample workbook with a desired result
Can't attach a file but, does this help visualize what I'm looking for?Picture2.jpg
I amended my macro- see post 6. I can not hep you I do not see in a sample format. You do not need to attach any book with confidential info, just a sample
AB33, thanks but my zero's are still showing up...not sure why. no confidential data; i just don't see the option to upload file, just see option to upload photo. bummed...but thanks again
Ah! I found attach file option... see attached.
Now, explain what is missing. I have attached two macros
Ok, rows 3,4,6,8 and 11 (all in grey) should be hidden, since they have no values in those rows
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks