Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default extract hidden date

I have date in range a1 to a2000
On only one line there will be a date. Is there a simplecommand that can find this date. At present i am using the following code.


Set CHECKRANGE = Columns(1).Cells
For Each CELL In CHECKRANGE
If CELL.Text Like "*##/##/20##*" Then
........
.........
NEXT CELL

an example of the date in column is " 146.01 153.80 n/a 0.06 -1.85 ( -1.3%) n/a 03/03/2006 0 £0.00 £0.00 n/a "
i need to find and extract that date.


Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default extract hidden date


you can use vlookup
If that doesn't work check out data, filter
I am not sure what you are doing with this date, are you just looking
to see if its there, or are you going to extract data from the column
beside it


--
davesexcel
------------------------------------------------------------------------
davesexcel's Profile: http://www.excelforum.com/member.php...o&userid=31708
View this thread: http://www.excelforum.com/showthread...hreadid=519109

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default extract hidden date

A slight modification of your code:

Dim v As Variant
Set CHECKRANGE = Range("A1:A" & Cells(Rows.Count, "A").End(xlUp).Row)
For Each cell In CHECKRANGE
v = Split(cell.Text, " ")
For i = LBound(v) To UBound(v)
If v(i) Like "*##/##/20##*" Then
MsgBox v(i)
GoTo Nextaction:
End If
Next i
Next cell
Nextaction:

HTH

"Sunil Patel" wrote:

I have date in range a1 to a2000
On only one line there will be a date. Is there a simplecommand that can find this date. At present i am using the following code.


Set CHECKRANGE = Columns(1).Cells
For Each CELL In CHECKRANGE
If CELL.Text Like "*##/##/20##*" Then
........
.........
NEXT CELL

an example of the date in column is " 146.01 153.80 n/a 0.06 -1.85 ( -1.3%) n/a 03/03/2006 0 £0.00 £0.00 n/a "
i need to find and extract that date.


Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default extract hidden date

One way:

Dim rCell As Range
Dim sExtract As String
For Each rCell In Range("A1:A" & _
Range("A" & Rows.Count).End(xlUp).Row)
With rCell
If .Text Like "*##/##/20##*" Then
sExtract = Mid(.Text, InStr(.Text, "/20") - 5, 10)
MsgBox .Address(False, False) & ": " & sExtract
End If
End With
Next rCell

Note: this is based on your example. If you had data like:

146.01 153.80 n/a 0.06 1/20 (-1.3%) n/a 03/03/2006 0 ...

this would need more sophisticated pattern matching


In article ,
"Sunil Patel" wrote:

I have date in range a1 to a2000
On only one line there will be a date. Is there a simplecommand that can find
this date. At present i am using the following code.


Set CHECKRANGE = Columns(1).Cells
For Each CELL In CHECKRANGE
If CELL.Text Like "*##/##/20##*" Then
.......
........
NEXT CELL

an example of the date in column is " 146.01 153.80 n/a 0.06 -1.85 (
-1.3%) n/a 03/03/2006 0 £0.00 £0.00 n/a "
i need to find and extract that date.


Thanks

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
extract date from last cell puiuluipui Excel Discussion (Misc queries) 5 September 14th 09 05:33 PM
extract date from text Woodi2 Excel Worksheet Functions 19 December 1st 08 11:19 PM
Extract Date christmaslog Excel Worksheet Functions 1 February 19th 06 10:28 AM
extract date from the most current date Cali00 Excel Discussion (Misc queries) 1 April 13th 05 02:05 PM
Extract date from cell Eric Excel Worksheet Functions 3 November 4th 04 06:37 PM


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