ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   View only items in the left column that have X's in right columns (https://www.excelbanter.com/excel-discussion-misc-queries/56895-view-only-items-left-column-have-xs-right-columns.html)

townieflo

View only items in the left column that have X's in right columns
 
I'm sure there is a simple function for this.

I have a master list of items in my far left column. The columns to their
right use various combinations of the masterlist for which I have placed an X
within the column in line/the row of the masterlist on the left.

How do I get the program to sort or eliminate both the items or rows not
with an X from the master list on the left along with eliminating from view
all the other columns but the one selected?

I want to be able to print individual reports showing how each individual
column matchs up with the master list. HELP

bob777

View only items in the left column that have X's in right columns
 

I think the reason you have no replies is that the problem is not
understood. Could you give an example such cells A1 to A5 contain the
names of 5 items of equipment, cells B1 to B5 contain X's or Y's, cells
C1 to C5 contain X's or Z's.

I want to be able to.....................


--
bob777
------------------------------------------------------------------------
bob777's Profile: http://www.excelforum.com/member.php...o&userid=28504
View this thread: http://www.excelforum.com/showthread...hreadid=487517


Dave Peterson

View only items in the left column that have X's in right columns
 
Manually, you could hide all the columns that you don't want to see, then filter
to show the non-blanks in that column. Then print that "view". Repeat as
required.

You could have a macro do it, too.

Option Explicit
Sub testme()

Dim iCol As Long
Dim myRng As Range
Dim LastRow As Long
Dim LastCol As Long
Dim wks As Worksheet

Set wks = Worksheets("sheet1")

With wks
.AutoFilterMode = False
LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
LastCol = .Cells(1, .Columns.Count).End(xlToLeft).Column

Set myRng = .Range("a1", .Cells(LastRow, LastCol))

myRng.AutoFilter

For iCol = 2 To LastCol
.Range("b1", .Cells(1, LastCol)).EntireColumn.Hidden = True
.Cells(1, iCol).EntireColumn.Hidden = False
If .FilterMode Then
.ShowAllData
End If
myRng.AutoFilter Field:=iCol, Criteria1:="<"
If myRng.Columns(1).Cells.SpecialCells(xlCellTypeVisi ble) _
.Cells.Count = 1 Then
'don't print--no data, just header row
Else
.PrintOut preview:=True
End If
Next iCol

.Range("b1", .Cells(1, LastCol)).EntireColumn.Hidden = False
If .FilterMode Then
.ShowAllData
End If
End With

End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm


townieflo wrote:

I'm sure there is a simple function for this.

I have a master list of items in my far left column. The columns to their
right use various combinations of the masterlist for which I have placed an X
within the column in line/the row of the masterlist on the left.

How do I get the program to sort or eliminate both the items or rows not
with an X from the master list on the left along with eliminating from view
all the other columns but the one selected?

I want to be able to print individual reports showing how each individual
column matchs up with the master list. HELP


--

Dave Peterson


All times are GMT +1. The time now is 05:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com