Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
hiding row if the cell is found in a differeent column
Hi,
sheet1 data 2 a 5 b 12 c sheet2 data 2 3 4 I would like to write a macro as follows: if I find the value in column a of sheet 1 IN column a in sheet 2, hide that column in sheet one (loop for the range of cells). I have the following so far: I am clearly having trouble figuring out the find portion. Thanks. Application.ScreenUpdating = False Application.Calculation = xlCalculationManual On Error GoTo Exits: If Selection.Rows.Count 1 Then Set Rng = Selection Else Set Rng = Range(Rows(1), Rows(ActiveSheet.Cells.SpecialCells(xlCellTypeLast Cell).Row())) End If RwCnt = 0 For Rw = Rng.Rows.Count To 1 Step -1 If Rng.Rows(Rw).entirerow.find( lookin: sheets("Sheet1"))= true Then Rng.Rows(Rw).EntireRow.Hidden = True RwCnt = RwCnt + 1 End If Next Rw Exits: Application.ScreenUpdating = True Application.Calculation = xlCalculationAutomatic End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating a range by going down a column until an empty cell is found | Excel Programming | |||
Hiding all rows where the cell value in column 13 of same row = $0.00 | Excel Programming | |||
Hiding all rows where the cell value in column 13 of same row = $0.00 | Excel Programming | |||
Hiding column if cell in previous column is empty-revised | Excel Programming | |||
determine the column where a cell was found | Excel Programming |