ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Get Date from one cell to format another, then... (https://www.excelbanter.com/excel-programming/413927-get-date-one-cell-format-another-then.html)

MattyO

Get Date from one cell to format another, then...
 
I want to take/copy/whatever? the date from a particular cell in the format
DD-MMM-YYYY, from there I want to format that date into MMM-YY into another
cell. After that has been complete, take that formatted date and auto fill 6
more columns with the past 6 months.

Another way to look at it:

(Take Cell A1) 18-JUN-2008 (Format Cell D1 like this) JUN-2008 (Then
auto fill F1:L1)JUN-2008 to JAN-2008

Please help.


Rick Rothstein \(MVP - VB\)[_2297_]

Get Date from one cell to format another, then...
 
Assuming you want a more general solution involving columns rather than a
single instance. Using your posted samples, select Column D and use Format
Cells with this custom format pattern, "mmm-yy" (assuming your example
incorrectly shows a 4-digit year when your text description said you want a
2-digit year), then select Columns F thru L and use Format Cells to custom
format them using this custom format pattern, "mmm-yyyy". Next, put this
formula in D1...

=IF(A1<"",A1,"")

Then put this formula in F1...

=IF(A1<"",A1,"")

And put this formula in G1 and *copy* it across to L1...

=IF(A1<"",F1+1,"")

Then select D1 and F1 thru L1 and *copy* them down as far as you like.

Rick


"MattyO" wrote in message
...
I want to take/copy/whatever? the date from a particular cell in the format
DD-MMM-YYYY, from there I want to format that date into MMM-YY into
another
cell. After that has been complete, take that formatted date and auto
fill 6
more columns with the past 6 months.

Another way to look at it:

(Take Cell A1) 18-JUN-2008 (Format Cell D1 like this) JUN-2008 (Then
auto fill F1:L1)JUN-2008 to JAN-2008

Please help.



MattyO

Get Date from one cell to format another, then...
 
Rick,

I'm very new at this. Can you provide me all the code?

"Rick Rothstein (MVP - VB)" wrote:

Assuming you want a more general solution involving columns rather than a
single instance. Using your posted samples, select Column D and use Format
Cells with this custom format pattern, "mmm-yy" (assuming your example
incorrectly shows a 4-digit year when your text description said you want a
2-digit year), then select Columns F thru L and use Format Cells to custom
format them using this custom format pattern, "mmm-yyyy". Next, put this
formula in D1...

=IF(A1<"",A1,"")

Then put this formula in F1...

=IF(A1<"",A1,"")

And put this formula in G1 and *copy* it across to L1...

=IF(A1<"",F1+1,"")

Then select D1 and F1 thru L1 and *copy* them down as far as you like.

Rick


"MattyO" wrote in message
...
I want to take/copy/whatever? the date from a particular cell in the format
DD-MMM-YYYY, from there I want to format that date into MMM-YY into
another
cell. After that has been complete, take that formatted date and auto
fill 6
more columns with the past 6 months.

Another way to look at it:

(Take Cell A1) 18-JUN-2008 (Format Cell D1 like this) JUN-2008 (Then
auto fill F1:L1)JUN-2008 to JAN-2008

Please help.




Rick Rothstein \(MVP - VB\)[_2298_]

Get Date from one cell to format another, then...
 
What I provided you is not code... those are worksheet formats (Format/Cells
from Excel's menu bar) and worksheet formulas (type them into the cells
where I indicated).

Rick


"MattyO" wrote in message
...
Rick,

I'm very new at this. Can you provide me all the code?

"Rick Rothstein (MVP - VB)" wrote:

Assuming you want a more general solution involving columns rather than a
single instance. Using your posted samples, select Column D and use
Format
Cells with this custom format pattern, "mmm-yy" (assuming your example
incorrectly shows a 4-digit year when your text description said you want
a
2-digit year), then select Columns F thru L and use Format Cells to
custom
format them using this custom format pattern, "mmm-yyyy". Next, put this
formula in D1...

=IF(A1<"",A1,"")

Then put this formula in F1...

=IF(A1<"",A1,"")

And put this formula in G1 and *copy* it across to L1...

=IF(A1<"",F1+1,"")

Then select D1 and F1 thru L1 and *copy* them down as far as you like.

Rick


"MattyO" wrote in message
...
I want to take/copy/whatever? the date from a particular cell in the
format
DD-MMM-YYYY, from there I want to format that date into MMM-YY into
another
cell. After that has been complete, take that formatted date and auto
fill 6
more columns with the past 6 months.

Another way to look at it:

(Take Cell A1) 18-JUN-2008 (Format Cell D1 like this) JUN-2008
(Then
auto fill F1:L1)JUN-2008 to JAN-2008

Please help.





MerleSmith

Get Date from one cell to format another, then...
 
Do you cross year boundaries? e.g. startdate of FEB-2008, which would cross
back into 2007. This makes the problem a little more complex.
--
Merle


"MattyO" wrote:

I want to take/copy/whatever? the date from a particular cell in the format
DD-MMM-YYYY, from there I want to format that date into MMM-YY into another
cell. After that has been complete, take that formatted date and auto fill 6
more columns with the past 6 months.

Another way to look at it:

(Take Cell A1) 18-JUN-2008 (Format Cell D1 like this) JUN-2008 (Then
auto fill F1:L1)JUN-2008 to JAN-2008

Please help.


MattyO

Get Date from one cell to format another, then...
 
Yes, it can cross into year boundaries. To provide further detail, I am
trying to add this additional code into an existing macro to handle some
additional formatting of a report that could be run every month. Apologies
for not adding these further details earlier.

"MerleSmith" wrote:

Do you cross year boundaries? e.g. startdate of FEB-2008, which would cross
back into 2007. This makes the problem a little more complex.
--
Merle


"MattyO" wrote:

I want to take/copy/whatever? the date from a particular cell in the format
DD-MMM-YYYY, from there I want to format that date into MMM-YY into another
cell. After that has been complete, take that formatted date and auto fill 6
more columns with the past 6 months.

Another way to look at it:

(Take Cell A1) 18-JUN-2008 (Format Cell D1 like this) JUN-2008 (Then
auto fill F1:L1)JUN-2008 to JAN-2008

Please help.


MattyO

Get Date from one cell to format another, then...
 
Anybody?


All times are GMT +1. The time now is 04:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com