PC Review


Reply
Thread Tools Rate Thread

Date formatting still causing me headaches

 
 
Corey
Guest
Posts: n/a
 
      14th Dec 2008
The code below fails to populate Listboxes 5-7 due to the date formating of
the sheet value and the Listbox4.
The sheet value ((myrow,4) is in a ddd dd mmm yy format, where the Listbox
keeps formatting to a mm/dd/yyyy.

I have tried to format the listbox4 before and after it is populated by:
ListBox4.Value = Format(.Cells(myrow, 4).Offset(, 3).Value , "dd/mm/yyyy")


But i still get NO result with the below due to a MATCH found but NOT
recognised at trhe highlighted line below.

Private Sub ListBox4_Click()
Application.ScreenUpdating = False
TextBox1.Value = ""
ListBox5.Clear
ListBox7.Clear
ListBox6.Clear
ListBox7.Clear
Dim LastCell As Long
Dim myrow As Long
LastCell = Worksheets("Data").Cells(Rows.Count, "D").End(xlUp).Row
With ActiveWorkbook.Worksheets("Data")
For myrow = 1 To LastCell
If .Cells(myrow, 4).Offset(, -3).Value <> "" And .Cells(myrow,
4).Offset(, -3).Value = ListBox1.Value And _
ListBox2.Value = .Cells(myrow, 4).Offset(, 3).Value And _
ListBox4.Value = .Cells(myrow, 4).Value Then ' <===== HERE

ListBox7.AddItem .Cells(myrow, 4).Offset(, 231).Value
ListBox5.AddItem .Cells(myrow, 4).Offset(, 230).Value
ListBox6.AddItem .Cells(myrow, 4).Offset(, 7).Value
End If

Next
End With
Sheets("Opening Page").Activate
Application.ScreenUpdating = True
End Sub


The code simply reducing possible senarios to ensure the correct row is
chaosen to be viewed in a sheet.
--
Corey ....
The Silliest Question is generally
the one i forgot to ask.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compatibility Checker causing headaches =?Utf-8?B?QnJpYW4=?= Microsoft Excel Programming 2 29th Jun 2007 03:46 PM
Phantom problems causing headaches Dazed and Confused Windows XP General 4 12th Oct 2006 10:59 PM
repost: headaches with formatting in VWD D. Shane Fowlkes Microsoft ASP .NET 2 17th Mar 2006 01:43 PM
Windows Upgrade Causing Campus Headaches Ron AG Windows XP General 1 24th Aug 2004 01:14 AM
[ENTER] key causing major headaches. Eric Microsoft ASP .NET 5 26th Jun 2004 12:19 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:18 PM.