Want only rows with populated data

P

Pete

Have a challenging project:
In A2, have a combobox with the ability for the user to select an item
in a dropdown.. Based on it's selection, it populates many other
columns of data throughout the worksheet.
In columns G,H,I,J, have some results for "Options", call them Option
1, 2 3, or 4 which get populated as well. but in some instances, the
result shown for an item returns a blank, as that column's "Option" is
not available for the item in that row. Is there a way which will
just show rows that contain option that it's present for that selected
row that has data returned in any of the 4 columns" This would leave
the blank rows (except for rows 1-3 which contain the input, and
descriptive data) off entirely if none of the 4 options have retreived
any data. Would like to have this all as a result of the dropdown,
and stay away from an manual autofilter. Have room for a helper
column.
TIA for any ideas.
Pete
 
P

Pete

Found this in one of the forums. Does the trick.
Pete
'
Sub HideRows()
Application.ScreenUpdating = False
Dim i As Integer
Dim RStart As Range
Dim REnd As Range
Set RStart = Range("G3")
Set REnd = Sheets("Presentation").Range("g65536").End(xlUp).Offset(0,
3)
Range(RStart, REnd).Select
On Error Resume Next
With Selection
..EntireRow.Hidden = False
For i = 1 To .Rows.Count
If WorksheetFunction.CountBlank(.Rows(i)) = 4 Then
..Rows(i).EntireRow.Hidden = True
End If
Next i
End With
Set RStart = Nothing
Set REnd = Nothing
Range("A1").Select
Application.ScreenUpdating = True
End Sub
 

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