#1   Report Post  
Jeff
 
Posts: n/a
Default Date with VBA

Hello,
I need to know if it is possible in a VBA macro to do the following:
In Worksheet # 1
I have the following text values in rows:
K1 30.11.2004
k2 24.12.2004
k3 30.10.2004
k4 25.11.2004
I would like to have a macro that would go through each line and determine the
oldest date and copy that date into Worksheet #2 with the format mn-yy. In
the example above: it'd be Oct-04
Thanks for any help,
JF



  #2   Report Post  
JulieD
 
Posts: n/a
Default

Hi Jeff

do you really need to use VBA or would the following formula in Sheet 2 work
for you?
=MIN(DATEVALUE(SUBSTITUTE(Sheet1!K1:K4,".","/")))

entered using control & shift & enter instead of just enter

Cheers
JulieD

"Jeff" wrote in message
...
Hello,
I need to know if it is possible in a VBA macro to do the following:
In Worksheet # 1
I have the following text values in rows:
K1 30.11.2004
k2 24.12.2004
k3 30.10.2004
k4 25.11.2004
I would like to have a macro that would go through each line and determine
the
oldest date and copy that date into Worksheet #2 with the format mn-yy. In
the example above: it'd be Oct-04
Thanks for any help,
JF





  #3   Report Post  
Jeff
 
Posts: n/a
Default

Thank you Julie,
Sorry, but I need a VBA macro to complete an existing macro.
Thanks,
JF

"JulieD" wrote:

Hi Jeff

do you really need to use VBA or would the following formula in Sheet 2 work
for you?
=MIN(DATEVALUE(SUBSTITUTE(Sheet1!K1:K4,".","/")))

entered using control & shift & enter instead of just enter

Cheers
JulieD

"Jeff" wrote in message
...
Hello,
I need to know if it is possible in a VBA macro to do the following:
In Worksheet # 1
I have the following text values in rows:
K1 30.11.2004
k2 24.12.2004
k3 30.10.2004
k4 25.11.2004
I would like to have a macro that would go through each line and determine
the
oldest date and copy that date into Worksheet #2 with the format mn-yy. In
the example above: it'd be Oct-04
Thanks for any help,
JF






  #4   Report Post  
JulieD
 
Posts: n/a
Default

Hi

well then how about

Sub findoldest()
Sheets("Sheet2").Range("c5").FormulaArray =
"=MIN(DATEVALUE(SUBSTITUTE(Sheet1!K1:K4,""."", ""/"")))"
End Sub


Cheers
JulieD

"Jeff" wrote in message
...
Thank you Julie,
Sorry, but I need a VBA macro to complete an existing macro.
Thanks,
JF

"JulieD" wrote:

Hi Jeff

do you really need to use VBA or would the following formula in Sheet 2
work
for you?
=MIN(DATEVALUE(SUBSTITUTE(Sheet1!K1:K4,".","/")))

entered using control & shift & enter instead of just enter

Cheers
JulieD

"Jeff" wrote in message
...
Hello,
I need to know if it is possible in a VBA macro to do the following:
In Worksheet # 1
I have the following text values in rows:
K1 30.11.2004
k2 24.12.2004
k3 30.10.2004
k4 25.11.2004
I would like to have a macro that would go through each line and
determine
the
oldest date and copy that date into Worksheet #2 with the format mn-yy.
In
the example above: it'd be Oct-04
Thanks for any help,
JF








  #5   Report Post  
Jeff
 
Posts: n/a
Default

Hi,

I have the following error: #VALUE!
Thanks,


"JulieD" wrote:

Hi

well then how about

Sub findoldest()
Sheets("Sheet2").Range("c5").FormulaArray =
"=MIN(DATEVALUE(SUBSTITUTE(Sheet1!K1:K4,""."", ""/"")))"
End Sub


Cheers
JulieD

"Jeff" wrote in message
...
Thank you Julie,
Sorry, but I need a VBA macro to complete an existing macro.
Thanks,
JF

"JulieD" wrote:

Hi Jeff

do you really need to use VBA or would the following formula in Sheet 2
work
for you?
=MIN(DATEVALUE(SUBSTITUTE(Sheet1!K1:K4,".","/")))

entered using control & shift & enter instead of just enter

Cheers
JulieD

"Jeff" wrote in message
...
Hello,
I need to know if it is possible in a VBA macro to do the following:
In Worksheet # 1
I have the following text values in rows:
K1 30.11.2004
k2 24.12.2004
k3 30.10.2004
k4 25.11.2004
I would like to have a macro that would go through each line and
determine
the
oldest date and copy that date into Worksheet #2 with the format mn-yy.
In
the example above: it'd be Oct-04
Thanks for any help,
JF











  #6   Report Post  
JulieD
 
Posts: n/a
Default

Hi Jeff

could be a line wrap problem - try

Sub findoldest()
Sheets("Sheet2").Range("c5").FormulaArray = _
"=MIN(DATEVALUE(SUBSTITUTE(Sheet1!K1:K4,""."", ""/"")))"
End Sub

if that doesn't work, could you copy and paste in the code you're using

Cheers
JulieD

"Jeff" wrote in message
...
Hi,

I have the following error: #VALUE!
Thanks,


"JulieD" wrote:

Hi

well then how about

Sub findoldest()
Sheets("Sheet2").Range("c5").FormulaArray =
"=MIN(DATEVALUE(SUBSTITUTE(Sheet1!K1:K4,""."", ""/"")))"
End Sub


Cheers
JulieD

"Jeff" wrote in message
...
Thank you Julie,
Sorry, but I need a VBA macro to complete an existing macro.
Thanks,
JF

"JulieD" wrote:

Hi Jeff

do you really need to use VBA or would the following formula in Sheet
2
work
for you?
=MIN(DATEVALUE(SUBSTITUTE(Sheet1!K1:K4,".","/")))

entered using control & shift & enter instead of just enter

Cheers
JulieD

"Jeff" wrote in message
...
Hello,
I need to know if it is possible in a VBA macro to do the following:
In Worksheet # 1
I have the following text values in rows:
K1 30.11.2004
k2 24.12.2004
k3 30.10.2004
k4 25.11.2004
I would like to have a macro that would go through each line and
determine
the
oldest date and copy that date into Worksheet #2 with the format
mn-yy.
In
the example above: it'd be Oct-04
Thanks for any help,
JF











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
Date updates from worksheet to chart & changes date to a date series! Help!! Jayjg Charts and Charting in Excel 2 January 22nd 05 03:00 PM
Date issue between Windows and Macintosh version dlg1967 Excel Discussion (Misc queries) 4 January 19th 05 03:51 PM
Need help troubleshooting an array formula XLXP on Win2K KR Excel Worksheet Functions 1 December 13th 04 07:41 PM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 02:06 AM
Using formulas to determine date in one cell based on date in anot Gary Excel Worksheet Functions 2 November 22nd 04 08:11 AM


All times are GMT +1. The time now is 08:15 PM.

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"