create new date format

May 9, 2011 at 23:55:05
Specs: Windows XP
Hi
I want to create new date format by calculate this in format cell because I do'nt want change cell value (like Hijri Date that calculate from cell value and no chage cell value)

See More: create new date format

Report •

#1
May 10, 2011 at 19:03:36
I, for one, have absolutely no clue as to what you are trying to do.

How about explaining what you are trying to do in a different manner?

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#2
May 10, 2011 at 22:40:55
hi
I am sorry. I must explain This better
please try this example
write a number on a cell like 40674
with format cell change format to DATE this cell show 2011/05/11
but cell value is 40674
Now, I want to know, How excel change a number to date in format cell progress with out another cell.
(I am so sorry my lang.is week)

Report •

#3
May 11, 2011 at 04:42:55
This is the part that I still don't understand:

How excel change a number to date in format cell progress with out another cell.

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

Related Solutions

#4
May 11, 2011 at 06:05:03
Hi
this is my ask.
in normal, excel calculate western date (format cell,number tab,date) but I want to calculate persian date. I can write a function for this, but this function write to another cell. For example:
a b c
1 2011/05/11 =mydate(a1)
2
3

show like this
a b c
1 2011/05/11 1390/02/21
2
3

but I want show like this

a b c
1 1390/02/21
2
3

I hope that I can explain it.


Report •

#5
May 11, 2011 at 08:08:52
Now I think I get it.

You want to avoid using a UDF in another cell so that you can enter a date in any cell and have it convert to the date format you want.

Why not try a Worksheet_Change macro that will fire as soon as you enter the date and change the value of the cell?

Whatever code you are using for the mydate() UDF could be used in a Worksheet_Change macro.

I don't know how your UDF works, so I'll use an example of some code that adds a year to any date entered into a worksheet:

Private Sub Worksheet_Change(ByVal Target As Range)
  If IsDate(Target) Then
    Application.EnableEvents = False
     Target = Target + 365
    Application.EnableEvents = False
  End If
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •

#6
May 12, 2011 at 01:19:25
thanks for your help

Report •

Ask Question