Custom Date Format To Be Retained In .csv Also

Mar 14, 2007

i have the required date as part of a string, which i need to pull out and then format it as "yyyy-mm-dd hh:mm:ss" and put it in another file which will be saved as .csv

Here is the code i am trying to modify without much success so far

Sub dateFormat()

Dim dtMydate As Date
Dim sMydate As String
Dim strWhen As String

strWhen = "As on 13-MAR-2007 14:45:59 Hours IST" ' the starting string
'strWhen = Cells. Find("As on")

'take out the date portion from strWhen
strWhen = Mid(strWhen, InStr(strWhen, "-") - 2, (InStr(strWhen, "Hours") - 1) - (InStr(strWhen, "-") - 2))

dtMydate = CDate(strWhen)
Debug.Print dtMydate 'returned value is 13/03/2007 2:45:59 PM

dtMydate = Format(dtMydate, "yyyy-mm-dd hh:mm:ss")
Debug.Print dtMydate 'returned value is again 13/03/2007 2:45:59 PM...

View 8 Replies


ADVERTISEMENT

Time Format Be Retained

Feb 20, 2009

I am struggling to cope with time (aren't we all).
I pick up a range of cells formatted on the worksheet as hh:mm. Put these into a macro and do some sorting. Then I place them on another worksheet but they arrive as time serials. The time serial appears as soon as the cells are placed in the macro.

How can I retain the hh:mm format from one worksheet to the next without having to manually reformat the cells?

Is there a VBA format method for individual array elements.

View 13 Replies View Related

Format Date In Cell To Custom Format?

Feb 21, 2014

I have a column in excel which gets populated in the format "2/1/1980" when copied from a different source. I want a macro to run on this column and convert this in the below format. Required format: '02-01-80 (note the ' symbol before 02 which will keep it as text)

Existing ----> Required
2/1/1980 --> '02-01-80
2/1/1970 --> '02-01-70
2/1/1983 --> '02-01-83

I need this macro to run on two columns and replace them with the required format. I can do a find and replace either in the sheet or through hard coding the VBA, but as the date format keeps growing, I would need to do this via code and hence requesting the same.

View 4 Replies View Related

Date Custom Format

Nov 22, 2006

How do you make custom date format to a cell in such a way that it appears e.g. "Jan-06"?

I tried custom format "Mmm-yy" but it still resulted to "jan-06".

I want the "J" here to be in the upper case.

View 9 Replies View Related

Custom Date Format

Apr 23, 2008

I have not learned the custom number format feature. If someone could give me the format for the cell to display:

4/23 Wed

View 9 Replies View Related

Custom Date Format: For 2 Dates

Jun 15, 2007

I want to display 2 dates in one cell and have them custom formatted.

Eg. Display in one cell: 26 Jun - 27 Jun

With text typed: 26-6 - 27-6
(Or something along the lines of)

I know that dd mmm will display one date. But I cannot get 2 dates formatted. I tried dd mmm; dd mmm" - "dd mmm, which didn't work.

View 9 Replies View Related

Create Custom Serialized Date Format

Jan 19, 2007

I am needing to create a sequential serial number using a format yyyy-nnn, where yyyy is the current year and nnn is a sequential number (2007-001). I've tried using both a formula and custom formats but cannot get the cell contents to display as desired. I've used TODAY()&"-"&"001", which gives a valid result of 39100-001, but this not what I need. I've tried many other combinations in the custom option for formatting the cell.

View 5 Replies View Related

Custom Date Format With Month All Caps

May 31, 2007

I am trying to get a custom date format that looks like:
30MAY07

I can get 30May07 with ddmmmyy but can't seem to find how to get the 3 letter month to display in caps.

Excel 2002 SP3 on WinXP

View 9 Replies View Related

Custom Format, Combined Date, Time And Letter

Dec 15, 2008

I have a lot of data in the following format: 20080531T085930. Formatting the cells with yyyymmddThhmmss doesn't seem to be working. What's the correct way to handle this?

View 3 Replies View Related

Date Time Picker Custom Format Property?

May 13, 2005

I'm trying to use the Date Time Picker control as a time picker and only want hours and minutes to show. Can this be done with its custom format property (Example)? The usual number formatting string doesn't seem to work.

View 6 Replies View Related

Extract Time From Custom Date And Time Format

Sep 23, 2009

I have a file that has the Date and Time combined into one cell. I want to separate the two, and cannot find anywhere on the net to do so!

This is the cells format:
d/mm/yyyy h:mm

Cells look like this:
28/05/2008 12:30

View 6 Replies View Related

Formatting Not Retained With CSV Files

Dec 26, 2006

1. Open notepad file. Type 01. Save it as "Book2.CSV". Close notepad.
2. Open Book2.CSV in excel

You will see that 01 is shown as 1.

I would like to retain 01 in Cell A1. How do I do this in CSV?

I know how to retain formatting in excel but not in CSV. You can do the following in Excel files:

In the cell A1, right click and choose 'Format Cells'. In the Number tab, choose the category as Custom. In the Type on the right hand side, I type in 00. The value 1 in the cell A1 gets converted to 01.

My question:
1. why is this formatting not retained with CSV files?
2. Is there a way to programmatically (macros) to correct this?

View 9 Replies View Related

Public Variable Not Being Retained

Feb 22, 2010

I've got several proccedures all inside a single module where I declare 7 variables as Public before the start of the first proccedure.

My structure is something like this:

Public v1 as Variant
Public v2 as Variant
.
.
.
Public v7 as Variant

Sub Proc1
Call Proc2 (defines v2 as name of a file opened by a user; inside Proc1)
Call Proc3 (inside Proc1)
Call Proc4 (inside Proc3)
Call Proc5 (inside Proc5)
End Sub

Sub Proc6
Here I use v2
call Proc7 (inside Proc6)
End Sub

Variable v2 is uniquely named and is only used to hold a file's name so that I can call upon that file in various procedures. However, after Proc1 ends, Proc 1 retains the variable names of some of my Public variables, but not all, including v2, which I need!

I've tried going through this all step-by-step, no joy/nothing apparently obvious. I've also turned on Tools-Options-General-Notify Before State Loss but this isn't generating anything either.

View 9 Replies View Related

ComboBox Entry Being Retained After Update

Aug 23, 2006

I have problems with updating my ComboBox (old entires remain and keep adding up)- I have built my application from posts on this site

Private Sub Worksheet_Activate()
Dim i As Integer

Sheets("DiagramAnk").ComboBox1.Clear

For i = 3 To 18

Sheets("DiagramAnk").ComboBox1.AddItem Sheets("DiagramAnk"). Cells(1, i).Text

Next

Sheets("DiagramAnk").ComboBox1.ListIndex = 0

End Sub

The code works if I remove the lines .Clear and .ListIndex=0

The list opions runs as Case in ComboBox1_Change()

View 9 Replies View Related

How Do I Custom Format ###.####.##

Mar 2, 2009

I have a 9 digit number that I want to format as 999.9999.99 Can anyone tall me how? Does anyone know a good link with pointers on custom formats?

View 9 Replies View Related

Custom Number Format..?

Apr 22, 2009

If I have the following info:

A1 = 5
A2 = -4
A3 = 0

How can I use Format Cells > Custom to have them display as:

A1 = 5 up
A2 = 4 dn
A3 = Level

I've been trying and trying but keep getting a message that I should use one of Excel's pre-defined formats.

View 3 Replies View Related

Custom Cell Format

Aug 30, 2009

I'm working on a workshet where ppl fill in vehicle numbers, but they all find their own unique ways to fill them up. Some of the examples are below:

MH 04TN 2315
HR 38G 9605
9605G
H9425
TN04A8451
GJ04 GA5142
KA 0072

3,4,7 are incomplete nos. while 1,2,5,6 are all complete nos. I want the format of these above nos. to look like this:

2315TN/MH04
9605G/HR38
9605G
9425H
8451A/TN04
5142GA/GJ04
0072KA

Can this be done automatically in a worksheet using the custom cell format function??.... because then it wud get formatted as necessary whenever someone enters a vehicle no. in that particular column.

View 4 Replies View Related

Find When Using Custom Format

Mar 6, 2014

I have a sheet which uses a 'Custom Format' in column A, '00000' to give each row a unique reference. Is there any way to do a 'Find' using this format, e.g. 00012, rather than just 12. Searching using '00012' doesn't find the appropriate cell, whereas using '12' does?

View 4 Replies View Related

Custom Format A Cell?

Feb 8, 2013

custom formatting a cell for accommodate a Canadian postal code. The postal code looks like this

v9s 2k5. 7 charactors l#l #l#. I would like to quickly enter the data and have excel capitalize the letters and add the space for me.

View 1 Replies View Related

Custom Number Format?

Mar 25, 2014

Looking for a custom number format which will show numbers as follows:

0 = -

1234.89 = 1,235

-1234.43 = (1,234)

View 5 Replies View Related

Leading Zero(s) / Custom Format? ()

Aug 23, 2007

I'm having trouble with the leading zeros of my ISBN#s; excel keeps chopping them off. I found a topic that discussed this issue, but it won't work for me.

http://www.mrexcel.com/board2/viewtopic.php?t=75303

I can't format them as text because I'm getting them as an isbn with dashes (ie:978-05689-256-7) and when I remove the dashes (even if its formatted as text) excel changes the number to 9780568.9E+12 (or something like that)

I think the solution would be to create a custom format (ie. 0000000000) to preserve the zeros, but I'm having 2 problems:

1. Since the ISBN#'s have 2 different formats (ISBN-10 & ISBN-13) I need to somehow check if the first 3 numbers are 978 then based on that it should be formatted either as ISBN-10 (0000000000) or ISBN-13 (0000000000000)

2. In the post that I linked to above it said that I won't be able to do a vlookup if its custom formatted. Is there any way around this?

View 6 Replies View Related

Custom Number Format ...

Jan 16, 2008

This workbook has 23 sheets for which this format will apply.

Under 1 man-hour .###
Over 1 man-hour #.##
Over 10 man-hour ##.#
Over 100 man-hour ###
Over 1000 man-hour #,###

View 13 Replies View Related

Custom Format For TEXT

Jan 7, 2009

I have a column in my sheet which I need to be displayed with dashes.

Excample: 123456 -> 12-235-6 (just an example)
But once in a while in the code is a letter like: 123A56 which obviously I need to be displayed like 12-3A5-6

But whatever I do, nothing seems to work.
Another cell with Left()-Mid()-Right() is no option for me....

View 10 Replies View Related

Custom Format Wildcard

Jun 11, 2009

Anyone know if a wildcard can be used in Custom Formatting using text leading off. Example:

U01234567

I have the above custom formatted as: "U"00-00-0000 which gives me U01-23-4567. This give me the format I need however; the U is not always constant and needs to be changed to different letters as required.

View 9 Replies View Related

Custom Format Interferes With Itself

Aug 8, 2006

I have a custom format that is applied to column AU. Here is the worksheet code which is placed in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Column <> 47 Then Exit Sub
If Target.Value = "" Then Exit Sub
On Error Goto Errhndl
Application.EnableEvents = False
Target.Value = "Map " & UCase(Left(Target.Value, 4)) & " <" & UCase(Mid(Target.Value, 5, 2)) & "-" & Right(Target.Value, 2) & ">"
Application.EnableEvents = True
Exit Sub

Errhndl:
Application.EnableEvents = True

End Sub


It works well on the sheet, if I remember to only put three numbers, three letters and then two more numbers (allwithout any spaces. Lowewr case ok). (eg. 122rmm25 is then transformed into Map 122R <MM-25>). On the sheet this works. Coming off of the UserForm, it tries to apply this format to text already formated and messes up royally!!!

Is there any way to either reverse this proccess coming off the UserForm or to stop the worksheet from appling this format to the value of the cell in question if the source is in the wrong format to be changed? How do I detect what format the text is in? (Raw, formatted correctly or over formatted)

View 2 Replies View Related

Creating Custom Data Bar Format

Feb 11, 2014

I'm looking at what appears to be a custom chart. It is a box divided into 4 equal quadrants. In each quadrant is a percentage with the total equaling 100%. In each of the quadrants there is fill equal to the percent that is numerically written in that quadrant. I'll post a picture with this, but if I was talking cells then....

A1 = 15% B1 = 66%
A2 = 4% B2 = 15%

The backround image behind the number is filled up by volume equal to the percentage indicated. They are also color coded with red representing the highest percentage quadrant filled.

To top that, there are little arrows along the sides of each quadrant indicating an average score.

My first question is WHAT TYPE OF CHART IS THIS THING!, and second can this be done in excel?

View 4 Replies View Related

Conditional Custom Number Format

Mar 6, 2009

I am trying to create a number format for formatting resistor value in their most commonly displayed form. For example 1,200 ohms would be displayed as 1.2kÙ and 5,000,000 ohms would be displayed as 5MÙ, and finally 5 ohms would be displayed as 5Ù. I have been able to create a format that formats any 2 contiguous formats but not all three.

for example: [>999999]###.0,,ÌÙ;[<1000000]###.0,kÙ;
or: [>999]###.0,kÙ;[<1000]###Ù

both work.(other similar criteria work as well) But if I try to put 3 conditions describing the desired formatting I get and error (containing no useful info) as I try to close the formatting dialog. Is there a limit to the number of conditions that can be used. Or something else I'm overlooking.

View 4 Replies View Related

Number Custom Format A Cell

May 31, 2009

is it possible to custom format a cell in order to:

a) Present 3.33333 as 3.33 (max. of 2 decimal digits or less)
b) Present 3.333 as 3.33
c) Present 3.33 as 3.33
d) Present 3.3 as 3.3
e) Present 3 as 3 (NO zeros and NO decimal dot)

View 5 Replies View Related

Creating A Custom Format For One Cell?

Apr 14, 2013

I want to create a custom format for a cell for entering in "cup measurements". I want to be able to type in 5, 1/4, 1/16, etc. and have the word "cups" appear after the number in that cell. I formatted the cell to say the word cups after typing in the numbers in my cell using the code "cups".

ex: 0 "cups" works fine for whole number

so then if i change it to 0/0 "cups" is works great for only 1/8 but not 1/16 or whole numbers. Then I looked at other custom codes that already existed in my formatts so I attempted to try this code which I just kinda came up with

_(0/00);_(0);_(0/0); "cups"

well it isn't doing what I want and If I use the 0/00 "cups code and I type in 4 cups the cell then says 4/01 cups.

What does my code need to be for me to show whole numbers and and size fraction without having it look weird?

View 2 Replies View Related

Format Custom - Padding Zero (0) Number

Feb 19, 2014

Format custom number setting for this below ; with condition, when I type following ;

1------001/2014 (showing data)
8------008/2014 (showing data)
45-----045/2014 (showing data)
17-----017/2014 (showing data)
364----364/2014 (showing data)

etc....

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved