Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello, I am looking for a way to do this. If any cell in row J is not blank then hide the entire row. my current code is Sub test() Dim cell As Range For Each cell In Worksheets("wshopcurrent").Range("j8:j8000") If cell.Text < "" Then Selection.EntireRow.Hidden = True End If Next End Sub but this seems to only hide the first one it finds and then stops. Can anyone help please? Thanks in advance John -- johncassell ------------------------------------------------------------------------ johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016 View this thread: http://www.excelforum.com/showthread...hreadid=393848 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It may be because you are hiding the current Selection, which has nothing to
do with your loop variable. Try cell.entireRow.hidden=true. The isEmpty(range) function is quite good for checking for blank cells as it doesn't throw up any errors. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello John
Amend Selection.EntireRow.Hidden = True To Cell.EntireRow.Hidden = True HTH Cordially Pascal "johncassell" a écrit dans le message de ... Hello, I am looking for a way to do this. If any cell in row J is not blank then hide the entire row. my current code is Sub test() Dim cell As Range For Each cell In Worksheets("wshopcurrent").Range("j8:j8000") If cell.Text < "" Then Selection.EntireRow.Hidden = True End If Next End Sub but this seems to only hide the first one it finds and then stops. Can anyone help please? Thanks in advance John -- johncassell ------------------------------------------------------------------------ johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016 View this thread: http://www.excelforum.com/showthread...hreadid=393848 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub test()
Dim cell As Range For Each cell In Worksheets("wshopcurrent").Range("j8:j8000") If cell.Text < "" Then cell.EntireRow.Hidden = True End If Next End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() That worked a treat, Thanks very much for your help people. Muc appreciated and thanks for replying in the first place. Joh -- johncassel ----------------------------------------------------------------------- johncassell's Profile: http://www.excelforum.com/member.php...fo&userid=2501 View this thread: http://www.excelforum.com/showthread.php?threadid=39384 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Slow VBA code....Hide/Unhide Loop | Excel Worksheet Functions | |||
Want to Hide columns in spreadsheet but NOT hide data in chart. | Charts and Charting in Excel | |||
Loop Function unable to loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |