Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / August 2008

Tip: Looking for answers? Try searching our database.

Date Format

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shoe3535 - 29 Aug 2008 17:56 GMT
I would like to convert a date that I've input from another program.  When I
input it I get 'Aug-28-2008.  I want it to just be a regular date - so it
would be *8/28/2008 if I were to select it in Format Cells.  
It says that I have General as the Category selected.  When I switch it to
Custom - nothing seems to happen.
Any suggestions?
Gary''s Student - 29 Aug 2008 18:21 GMT
First create a small table in the worksheet:

Jan    1
Feb    2
Mar    3
Apr    4
May    5
Jun    6
Jul    7
Aug    8
Sep    9
Oct    10
Nov    11
Dec    12

and assign the name:
nmths
to the table.  Then, with your data in A1, try:

=DATE(RIGHT(A1,4),VLOOKUP(LEFT(A1,3),mnths,2,FALSE),MID(A1,5,2))

Signature

Gary''s Student - gsnu200802

Tangier - 29 Aug 2008 22:15 GMT
On Aug 29, 12:21 pm, Gary''s Student
<GarysStud...@discussions.microsoft.com> wrote:
> First create a small table in the worksheet:
>
[quoted text clipped - 19 lines]
> --
> Gary''s Student - gsnu200802

very simply, create a macro and convert the date. The macro code will
look like this:

Sub dateconvert()
       Cells.Replace What:="Aug-28-2008", Replacement:="8/28/2008",
LookAt:=xlPart _
       , SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:=False, _
       ReplaceFormat:=False

End Sub

Assign this macro to your worksheet and run it, it should convert all
the dates that look like Aug-28-2008
Rick Rothstein - 29 Aug 2008 22:30 GMT
Where do you see that apostrophe in front of the text... in the cell and
Formula Bar or only in the Formula Bar? Either way, the first thing to do is
select all your "dates" (which are really text that look like a date). Then,
if you see the apostrophe in the cell, then click Edit/Replace on Excel's
menu bar, put an apostrophe (') in the "Find what" field, leave the "Replace
with" field empty and click OK. Now, do the following for either case... the
cells where we just removed the apostrophe or for the case where the
apostrophe was only in the Formula Bar... click Data/TextToColumn, click
Next twice on the dialog box that appears, select the "Date" option button
in the "Column data format" section on the dialog page you end up on after
clicking Next the second time, then click the Finish button. Your entries
should now be real dates that you can use Format/Cell (from Excel's menu
bar) to make it display anyway that you want.

Signature

Rick (MVP - Excel)

>I would like to convert a date that I've input from another program.  When
>I
[quoted text clipped - 3 lines]
> Custom - nothing seems to happen.
> Any suggestions?
Tangier - 29 Aug 2008 22:39 GMT
On Aug 29, 4:30 pm, "Rick Rothstein"
<rick.newsNO.S...@NO.SPAMverizon.net> wrote:
> Where do you see that apostrophe in front of the text... in the cell and
> Formula Bar or only in the Formula Bar? Either way, the first thing to do is
[quoted text clipped - 22 lines]
>
> - Show quoted text -

Rick, if I am searching and replacing xcontents in a cell, how do I
specify SearchOrder: to just search one column, or one row????
Rick Rothstein - 30 Aug 2008 19:42 GMT
Instead of using Cells as the starting reference range, use a more
restricted range and the search/replace will occur within that range only.
For example, to modify your posted code to handle, say, Column B only...

Sub dateconvert()
 Range("B:B").Replace What:="Aug-28-2008", Replacement:="8/28/2008", _
                      LookAt:=xlPart, SearchOrder:=xlByRows, _
                      MatchCase:=False, SearchFormat:=False, _
                      ReplaceFormat:=False
End Sub

Signature

Rick (MVP - Excel)

On Aug 29, 4:30 pm, "Rick Rothstein"
<rick.newsNO.S...@NO.SPAMverizon.net> wrote:
> Where do you see that apostrophe in front of the text... in the cell and
> Formula Bar or only in the Formula Bar? Either way, the first thing to do
[quoted text clipped - 31 lines]
>
> - Show quoted text -

Rick, if I am searching and replacing xcontents in a cell, how do I
specify SearchOrder: to just search one column, or one row????
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.