LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Hide rows without data in a column based on active cell

Op woensdag 9 maart 2016 23:11:30 UTC+1 schreef Claus Busch:
Hi Johan,

Am Wed, 9 Mar 2016 23:04:00 +0100 schrieb Claus Busch:

try dollowing code in the module of the expected worksheet:


sorry, I didn't read carefully. Try instead:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim LCol As Long

LCol = Cells(2, Columns.Count).End(xlToLeft).Column
If Intersect(Target, Range(Cells(1, 1), Cells(2, LCol))) Is _
Nothing Or Target.Count 1 Then Exit Sub

If Target.Row = 1 Then
ActiveSheet.AutoFilterMode = False
Else
ActiveSheet.UsedRange.AutoFilter field:=Target.Column, _
Criteria1:="<" & ""
End If
End Sub


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional



THANKS A LOT. WORKS VERY GOOD !!!!!!!!!!!!!!

Regards, Johan :)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide rows based on cell data Munchkin Excel Programming 5 July 29th 09 09:29 PM
Hide/Show Rows based on Cell Value with Data Validation Shelly Excel Programming 3 January 4th 08 11:01 PM
Macro to Hide rows based on value of column F Scott Marcus Excel Discussion (Misc queries) 10 October 27th 06 11:57 PM
How to hide a column once any cell of that col. is not active any Frederic Excel Programming 1 May 25th 05 02:21 PM
chk box to filter or hide rows based on value in a column deanop Excel Programming 6 January 7th 05 02:27 AM


All times are GMT +1. The time now is 01:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"