Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Hide Blank rows from ListBox1

Hi,

I am using the below code in my userform, to hide unwanted blank rows
in Listbox,


My data is coming after filtration procedure to AP5:AY
filtered data is veriable, some times 5 rows and some time 50 rows
and
some time 70 rows. I want to see only the filtered rows in the list
box.


but this procedure is not working in my new form.


your procedure is working in other file, but in this file its making
problem.


Option Explicit


Dim LastRow As Long


Private Sub Userform_Initialize()


Sheets("DailyIssue").Select


'for Listbox Scrol bar hide unwanted rows.
LastRow = Worksheets("DailyIssue").Cells(Rows.Count,
"a").End(xlUp).Row
ListBox1.RowSource = "AP5:AY" & LastRow


StartDate = ""
EndDate = ""
MaterialName = ""
CoboCategory = ""
TxtTRNo = ""
CoboEmployee = ""
StartDate.SetFocus


End Sub


Private Sub CommandButton1_Click()


range("A4:J5000").AdvancedFilter Action:=xlFilterCopy,
CriteriaRange:=range _
("AP1:AY3"), CopyToRange:=range("AP4:AY500"), Unique:=False


Selection.End(xlUp).Select


Sheets("DailyIssue").Select
range("AP3:AY3") = ""


End Sub


Can you check where is the mistake.


Best Regards


Syed Shahzad Zafar

Reply
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 Blank Rows TamIam Excel Worksheet Functions 3 May 6th 09 08:42 PM
How to hide rows, but not blank rows used for formatting hko78 Excel Programming 10 May 14th 08 07:58 PM
hide blank rows violet Excel Programming 3 November 9th 06 09:20 AM
Hide Blank Rows dee Excel Worksheet Functions 2 May 17th 06 11:30 PM
(Worksheet)Listbox1.additem = (Form)Listbox1.value ?? Tom Ogilvy Excel Programming 0 September 2nd 03 07:36 PM


All times are GMT +1. The time now is 07:28 PM.

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

About Us

"It's about Microsoft Excel"