Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Visual Basic/ Macro date formatting in Excel 97

Can anyone please advise on the following:

A spreadsheet I use identifies specific years in columns A
& B. Is there a simple way of changing the date from just
the years ( say 1995 & 2000) to the first and last dates
in the years in columns A & B . Effectively the years
would become 01/01/1995 in column A and 31/12/2000 in
column B. The years will obviously vary but I need the
first and last dates of the years in columns A & B

What I'm trying to do is limit my keying as the
spreadsheet is filtered at a later date and the majority
of info isn't needed at this point so a quick automatic
way of entering dates in the DD/MM/YYYY format would be
welcome

Many thanks for any help you can give

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Visual Basic/ Macro date formatting in Excel 97

Frank, use two empty columns (used as temporary, then you can copy paste
special values on top of A and B), format as date and type in the
following two formulae (example for row 1):

=DATEVALUE("01/01/" & A1)
=DATEVALUE("31/12/" & B1)

HTH,
Nikos

"Frank" wrote in message
...
Can anyone please advise on the following:

A spreadsheet I use identifies specific years in columns A
& B. Is there a simple way of changing the date from just
the years ( say 1995 & 2000) to the first and last dates
in the years in columns A & B . Effectively the years
would become 01/01/1995 in column A and 31/12/2000 in
column B. The years will obviously vary but I need the
first and last dates of the years in columns A & B

What I'm trying to do is limit my keying as the
spreadsheet is filtered at a later date and the majority
of info isn't needed at this point so a quick automatic
way of entering dates in the DD/MM/YYYY format would be
welcome

Many thanks for any help you can give



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Visual Basic/ Macro date formatting in Excel 97

Hi
use the formulas
=DATE(YEAR(A1),1,1)
and
=DATE(YEAR(B1),12,31)

in some helper columns (e.g. C + D). Copy them down and copy the values
and insert the conten as values to clear the formulas


--
Regards
Frank Kabel
Frankfurt, Germany


Frank wrote:
Can anyone please advise on the following:

A spreadsheet I use identifies specific years in columns A
& B. Is there a simple way of changing the date from just
the years ( say 1995 & 2000) to the first and last dates
in the years in columns A & B . Effectively the years
would become 01/01/1995 in column A and 31/12/2000 in
column B. The years will obviously vary but I need the
first and last dates of the years in columns A & B

What I'm trying to do is limit my keying as the
spreadsheet is filtered at a later date and the majority
of info isn't needed at this point so a quick automatic
way of entering dates in the DD/MM/YYYY format would be
welcome

Many thanks for any help you can give


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 80
Default Visual Basic/ Macro date formatting in Excel 97

Frank, use two empty columns (used as temporary, then you can copy paste
special values on top of A and B), format as date and type in the
following two formulae (example for row 1):

=DATEVALUE("01/01/" & A1)
=DATEVALUE("31/12/" & B1)

HTH,
Nikos

"Frank" wrote in message
...
Can anyone please advise on the following:

A spreadsheet I use identifies specific years in columns A
& B. Is there a simple way of changing the date from just
the years ( say 1995 & 2000) to the first and last dates
in the years in columns A & B . Effectively the years
would become 01/01/1995 in column A and 31/12/2000 in
column B. The years will obviously vary but I need the
first and last dates of the years in columns A & B

What I'm trying to do is limit my keying as the
spreadsheet is filtered at a later date and the majority
of info isn't needed at this point so a quick automatic
way of entering dates in the DD/MM/YYYY format would be
welcome

Many thanks for any help you can give



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
Visual Basic Help - Pivot table, formatting colors PJS Excel Discussion (Misc queries) 0 July 14th 06 01:41 AM
Visual Basic Macro negzel Excel Discussion (Misc queries) 1 December 28th 04 10:53 PM
Visual Basic macro to do something that is done trhough an Excel function Thierry[_2_] Excel Programming 2 December 11th 03 08:58 AM
visual basic macro in excel Patrick Molloy[_9_] Excel Programming 0 July 23rd 03 09:12 AM
visual basic macro in excel Patrick Molloy Excel Programming 0 July 23rd 03 07:49 AM


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