ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   why did the macro stopped working? (https://www.excelbanter.com/excel-programming/295417-why-did-macro-stopped-working.html)

Martyn

why did the macro stopped working?
 
I used to activate the below macro via a control button for changing column
E data format from "dd.mm.yyyy" to "dd/mm/yyyy" of a worksheet. But it ain't
working recently. Any ideas why? (p.s. : recently u/g to WinXL from Win98).
=================
Sub Macro2()
Columns("E:E").Replace _
What:=".", _
Replacement:="/", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub
=================
TIA
Martyn W.




Frank Kabel

why did the macro stopped working?
 
Hi
if you have real dates in this column you should change the number
format. try
Columns("E:E").numberformat = "DD/MM/YYYY"

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
I used to activate the below macro via a control button for changing
column E data format from "dd.mm.yyyy" to "dd/mm/yyyy" of a
worksheet. But it ain't working recently. Any ideas why? (p.s. :
recently u/g to WinXL from Win98). =================
Sub Macro2()
Columns("E:E").Replace _
What:=".", _
Replacement:="/", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub
=================
TIA
Martyn W.



Martyn

why did the macro stopped working?
 
Hi Frank,
Unfortunately that didn't effect anything. I checked the original format of
data in my column E:E and confirm that they are in "gg/aa/yyyy" format
(correct date format for my friend: format in Turkish language). And I am a
bit confused why I should be using "numberformat" in code?
TIA

"Frank Kabel" wrote in message
...
Hi
if you have real dates in this column you should change the number
format. try
Columns("E:E").numberformat = "DD/MM/YYYY"

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
I used to activate the below macro via a control button for changing
column E data format from "dd.mm.yyyy" to "dd/mm/yyyy" of a
worksheet. But it ain't working recently. Any ideas why? (p.s. :
recently u/g to WinXL from Win98). =================
Sub Macro2()
Columns("E:E").Replace _
What:=".", _
Replacement:="/", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub
=================
TIA
Martyn W.





Frank Kabel

why did the macro stopped working?
 
Hi
a date format is a number format. So if you have stored your dates as
real date values you only change the format of the cell. Trying to
replace the delimiters won't work as they're just a format (and not
really within the cell).
Also you don't have to change the format string within the code to your
regional settings (VBA expects english indetifiers - I have to use
them also in my German Excel)

so could you check if the values in your column are real dates. E.g.
enter the worksheetfunction
=ISNUMBER(E1)
this should return TRUE

--
Regards
Frank Kabel
Frankfurt, Germany

"Martyn" schrieb im Newsbeitrag
...
Hi Frank,
Unfortunately that didn't effect anything. I checked the original

format of
data in my column E:E and confirm that they are in "gg/aa/yyyy"

format
(correct date format for my friend: format in Turkish language). And

I am a
bit confused why I should be using "numberformat" in code?
TIA

"Frank Kabel" wrote in message
...
Hi
if you have real dates in this column you should change the number
format. try
Columns("E:E").numberformat = "DD/MM/YYYY"

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
I used to activate the below macro via a control button for

changing
column E data format from "dd.mm.yyyy" to "dd/mm/yyyy" of a
worksheet. But it ain't working recently. Any ideas why? (p.s. :
recently u/g to WinXL from Win98). =================
Sub Macro2()
Columns("E:E").Replace _
What:=".", _
Replacement:="/", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub
=================
TIA
Martyn W.






Martyn

why did the macro stopped working?
 
Hi Frank,
Yes the values in my column E are real dates.
I've checked the worksheetfunctin
=ISNUMBER(E1)
=ISNUMBER(E2)
....
...
=ISNUMBER(E100) etc

and all gives me the results TRUE.
Now what can I do?
Regards


"Frank Kabel" wrote in message
...
Hi
a date format is a number format. So if you have stored your dates as
real date values you only change the format of the cell. Trying to
replace the delimiters won't work as they're just a format (and not
really within the cell).
Also you don't have to change the format string within the code to your
regional settings (VBA expects english indetifiers - I have to use
them also in my German Excel)

so could you check if the values in your column are real dates. E.g.
enter the worksheetfunction
=ISNUMBER(E1)
this should return TRUE

--
Regards
Frank Kabel
Frankfurt, Germany

"Martyn" schrieb im Newsbeitrag
...
Hi Frank,
Unfortunately that didn't effect anything. I checked the original

format of
data in my column E:E and confirm that they are in "gg/aa/yyyy"

format
(correct date format for my friend: format in Turkish language). And

I am a
bit confused why I should be using "numberformat" in code?
TIA

"Frank Kabel" wrote in message
...
Hi
if you have real dates in this column you should change the number
format. try
Columns("E:E").numberformat = "DD/MM/YYYY"

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
I used to activate the below macro via a control button for

changing
column E data format from "dd.mm.yyyy" to "dd/mm/yyyy" of a
worksheet. But it ain't working recently. Any ideas why? (p.s. :
recently u/g to WinXL from Win98). =================
Sub Macro2()
Columns("E:E").Replace _
What:=".", _
Replacement:="/", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub
=================
TIA
Martyn W.







Frank Kabel

why did the macro stopped working?
 
Hi
then simply changing the format with a procedure like
sub foo()
Columns("E:E").numberformat = "DD/MM/YYYY"
end sub

should change your format of this column

--
Regards
Frank Kabel
Frankfurt, Germany

"Martyn" schrieb im Newsbeitrag
...
Hi Frank,
Yes the values in my column E are real dates.
I've checked the worksheetfunctin
=ISNUMBER(E1)
=ISNUMBER(E2)
...
..
=ISNUMBER(E100) etc

and all gives me the results TRUE.
Now what can I do?
Regards


"Frank Kabel" wrote in message
...
Hi
a date format is a number format. So if you have stored your dates

as
real date values you only change the format of the cell. Trying to
replace the delimiters won't work as they're just a format (and not
really within the cell).
Also you don't have to change the format string within the code to

your
regional settings (VBA expects english indetifiers - I have to use
them also in my German Excel)

so could you check if the values in your column are real dates.

E.g.
enter the worksheetfunction
=ISNUMBER(E1)
this should return TRUE

--
Regards
Frank Kabel
Frankfurt, Germany

"Martyn" schrieb im Newsbeitrag
...
Hi Frank,
Unfortunately that didn't effect anything. I checked the original

format of
data in my column E:E and confirm that they are in "gg/aa/yyyy"

format
(correct date format for my friend: format in Turkish language).

And
I am a
bit confused why I should be using "numberformat" in code?
TIA

"Frank Kabel" wrote in message
...
Hi
if you have real dates in this column you should change the

number
format. try
Columns("E:E").numberformat = "DD/MM/YYYY"

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
I used to activate the below macro via a control button for

changing
column E data format from "dd.mm.yyyy" to "dd/mm/yyyy" of a
worksheet. But it ain't working recently. Any ideas why?

(p.s. :
recently u/g to WinXL from Win98). =================
Sub Macro2()
Columns("E:E").Replace _
What:=".", _
Replacement:="/", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub
=================
TIA
Martyn W.








Martyn

why did the macro stopped working?
 
Thanks Frank, but somehow it doesn't help!.

"Frank Kabel" wrote in message
...
Hi
then simply changing the format with a procedure like
sub foo()
Columns("E:E").numberformat = "DD/MM/YYYY"
end sub

should change your format of this column

--
Regards
Frank Kabel
Frankfurt, Germany





Frank Kabel

why did the macro stopped working?
 
Hi
what is happening exactly?

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
Thanks Frank, but somehow it doesn't help!.

"Frank Kabel" wrote in message
...
Hi
then simply changing the format with a procedure like
sub foo()
Columns("E:E").numberformat = "DD/MM/YYYY"
end sub

should change your format of this column

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn

why did the macro stopped working?
 
Hi Frank, Actually "nothing" changes when I execute the macro!. No error
messages, but
the E column "." symbols are not replaced with "/".


"Frank Kabel" wrote in message
...
Hi
what is happening exactly?

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
Thanks Frank, but somehow it doesn't help!.

"Frank Kabel" wrote in message
...
Hi
then simply changing the format with a procedure like
sub foo()
Columns("E:E").numberformat = "DD/MM/YYYY"
end sub

should change your format of this column

--
Regards
Frank Kabel
Frankfurt, Germany






Frank Kabel

why did the macro stopped working?
 
Hi
are you sure you have real numbers/dates in this column?

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
Hi Frank, Actually "nothing" changes when I execute the macro!. No
error messages, but
the E column "." symbols are not replaced with "/".


"Frank Kabel" wrote in message
...
Hi
what is happening exactly?

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
Thanks Frank, but somehow it doesn't help!.

"Frank Kabel" wrote in message
...
Hi
then simply changing the format with a procedure like
sub foo()
Columns("E:E").numberformat = "DD/MM/YYYY"
end sub

should change your format of this column

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn

why did the macro stopped working?
 
Yes I am sure.

"Frank Kabel" wrote in message
...
Hi
are you sure you have real numbers/dates in this column?

--
Regards
Frank Kabel
Frankfurt, Germany





Frank Kabel

why did the macro stopped working?
 
Hi
o.k.
mail me your file and describe in your mail what exactly is not working
and I'll have a look at it
email: frank[dot]kabel[at]freenet[dot]de

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
Yes I am sure.

"Frank Kabel" wrote in message
...
Hi
are you sure you have real numbers/dates in this column?

--
Regards
Frank Kabel
Frankfurt, Germany



Martyn

why did the macro stopped working?
 
Hi,
I've sent the file to your email with detailed info...
TIA
Martyn

"Frank Kabel" wrote in message
...
Hi
o.k.
mail me your file and describe in your mail what exactly is not working
and I'll have a look at it
email: frank[dot]kabel[at]freenet[dot]de

--
Regards
Frank Kabel
Frankfurt, Germany


Martyn wrote:
Yes I am sure.

"Frank Kabel" wrote in message
...
Hi
are you sure you have real numbers/dates in this column?

--
Regards
Frank Kabel
Frankfurt, Germany






All times are GMT +1. The time now is 11:51 PM.

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