I've got a big problem with VBA in MS Excel '97 ...
I am trying to assign a NumberFormat to several Columns on my active
Worksheet. For the first two times it works fine
ActiveSheet.Columns("B").NumberFormat = "000000" (display
everything
with 6 digits)
In the third column I'm trying to assing a format for german currency,
ActiveSheet.Columns("c").NumberFormat = "#.##0,00 DM_);[Rot]
(#.##0,00 DM)"
but it won't work even though I copy/pasted that line from VBA help
..
VBA reports an error "1004", that is in the original german version
"Die NumberFormat-Eigenschaft des Range-Objekts kann nicht festgelegt
werden" and translated something like "The NumberFormat property of
the Range-Object can not be assigned"
Anyone has heard of that error or knows how to deal with it ? Or even
better is someone out there who can tell me how to assign that
NumberFormat to that column ?
Thanks for you help
Sebastian
For replying via eMail please remove the .nospam from my eMail
Hallo Sebastian,
the following line will work in the german version of XL8 and the
german countrysettings:
Worksheets("Tabelle1").Columns("C").NumberFormat = _
"#,##0.00 $_);[Red](#,##0.00 $)"
MfG Frank
__________________________________________________________
Frank Arendt-Theilen, MVP für Microsoft Excel
E-Mail: Thei...@t-online.de
da dies eine deutschsprachige Newsgroup ist und man an der Uni Mannheim
vermutlich Deutsch spricht ;-), versuch ich's mal in Deutsch:
Probier mal
ActiveSheet.Columns("c").NumberFormat = "#,##0.00 $"
für positive DM-Beträge, also $ statt DM (Bill Gates sei dank).
Gruß
Martin Beck
Sebastian Wenner <Sebastian.W...@gmx.net> schrieb in im
Newsbeitrag: 37dcdb4d...@news.uni-mannheim.de...
> Hi folks,
>
> I've got a big problem with VBA in MS Excel '97 ...
> I am trying to assign a NumberFormat to several Columns on my active
> Worksheet. For the first two times it works fine
>
> ActiveSheet.Columns("B").NumberFormat = "000000" (display
> everything
> with 6 digits)
>
> In the third column I'm trying to assing a format for german currency,
>
>
> ActiveSheet.Columns("c").NumberFormat = "#.##0,00 DM_);[Rot]
> (#.##0,00 DM)"
>
> but it won't work even though I copy/pasted that line from VBA help
> ..
> VBA reports an error "1004", that is in the original german version
> "Die NumberFormat-Eigenschaft des Range-Objekts kann nicht festgelegt
> werden" and translated something like "The NumberFormat property of
> the Range-Object can not be assigned"
> Anyone has heard of that error or knows how to deal with it ? Or even
> better is someone out there who can tell me how to assign that
> NumberFormat to that column ?
>
Hatte das ".de." mal fix übersehen heute morgen ... *sorry*
Aber ich hab mitlerweile die Lösung für das Problem gefunden
(bekommen), NumberFormatLocal funiert besser.
Zwar funktionier es jetzt, doch ist das Problem damit noch nicht
gelöst, aber das ist ein anderes Problem.
Und um keine falsche Identität vorzugaukeln, ich bin nicht im RZ
beschäftigt sondern nur Student dort ...
Trotzdem danke für die Hilfe
Sebastian