LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Cell Date and Listbox Date formats

I am trying to get the correct line of code to ensure a MATCH is made in 2
dates.
1 date is in a sheet in the "ddd dd mmm yy" format, and the other is in the
dd/mm/yyyy format in a userfrom Listbox.

The line of code is highlighted by the arrow.
The dates DO MATCH, but i do not get a result as the dates are in different
formats, and retrun a FASLE Positive result.

I tried changing the .Value of each to VAL(.Cells) & Val(Listbox) etc but
NOTHING
Also tried changing the .Value to .Date also with NO result.

Can someone asist with this ?

Private Sub ListBox4_Click()
Application.ScreenUpdating = False
ListBox5.Clear
ListBox7.Clear
ListBox6.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

--
Corey ....
The Silliest Question is generally
the one i forgot to ask.


 
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
date in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
Dealing with date formats on expiration date bliten_bsas Excel Programming 1 October 4th 07 08:47 PM
The Cell formats keep changing itself from text to date Hervinder Excel Discussion (Misc queries) 2 November 16th 06 03:56 PM
date formats Steve Excel Discussion (Misc queries) 4 November 10th 06 04:44 PM
Changing Cell formats to date fields automatically PCLIVE Excel Worksheet Functions 3 April 12th 05 10:34 PM


All times are GMT +1. The time now is 12:15 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"