Anzeige
Anzeige
HERBERS
Excel-Forum (Archiv)
20+ Jahre Excel-Kompetenz: Von Anwendern, für Anwender
Inhaltsverzeichnis

Wie schreibe ich Excel-Makro..

Forumthread: Wie schreibe ich Excel-Makro..

Wie schreibe ich Excel-Makro..
22.06.2003 12:34:07
Wei Chen
I have an excel-shit. The first colume is the name, from the second colume is the value, it looks like:

Col.1 Col.2
name1 | n1
name2 | n2-1, n2-2
name3 | n3

If I save it in CSV-format, it looks as follow when I open it in txt-editor:
name1;n1
name2;n2-1,n2-2
name3;n3

Now I want to save the sheet in the following format:
n1;n2-1,n2-2;n3
or:
n1;n2-1,n2-2;n3;

That means, the first colume must be taken off and the data follows line by line and devided by a semi-colume.

How can I write a makro in Excel?


Anzeige

3
Beiträge zum Forumthread
Beiträge zu diesem Forumthread

Betreff
Datum
Anwender
Anzeige
Re: Wie schreibe ich Excel-Makro..
22.06.2003 13:14:27
andre

hello wei chen,
... what a shit with the sheet in the first line ... ;-)
i think, you can record it with the makro-recorder.
- start the recorder
- select all datas you need and copy them
- change to an other sheet and insert the datas - but mark the option 'transponse' (i hope, it's so named in english)
- save it in csv-format
is it that, what you want?
regards andre

Anzeige
Re: Wie schreibe ich Excel-Makro..
23.06.2003 14:51:06
Wei Chen

Hallo Andre,

sorry für das Vertippen. Natürlich habe ich hier "sheet", nicht "shit" gemeint. ;-)

Also, Deine Antwort kann leider mein Problem löschen. Wenn ich einfach unter CSV speichen, dann sind die Daten untereinander gespeichert. Was ich will ist hintereinander und zwar in einer TXT-Datei.

Gruß

Wei Chen

Anzeige
Re: Wie schreibe ich Excel-Makro..
23.06.2003 20:20:01
andre

hallo wei chen,
hier mal ein makro, so wie ich es meine:

Sub Makro1()
'
' Makro1 Makro
' Makro am 23.06.2003 von wanderer aufgezeichnet
    Range("B1:B10").Select
    Selection.Copy
    Sheets("Tabelle2").Select
    Selection.PasteSpecial Paste:=xlAll, Operation:=xlNone, SkipBlanks:=False _
        , Transpose:=True
    Application.CutCopyMode = False
    ActiveWorkbook.SaveAs Filename:= _
        "C:\Dokumente und Einstellungen\SchauAn\Eigene Dateien\Mappe1.txt", FileFormat _
        :=xlUnicodeText, CreateBackup:=False
End Sub
 
     Code eingefügt mit Syntaxhighlighter 1.16

auf tabelle 1 stehen von b1 bis b10 untereinander daten. diese werden nach tabelle2 kopiert und transponiert, und dann als text gespeichert. der text sieht dann so aus:


1 2 3 4 5 6 7 8 9 0
 
     Code eingefügt mit Syntaxhighlighter 1.16

das ganze geht allerdings nur bis 256 zellen, weil es nicht mehr spalten gibt.

gruss andre

Anzeige
;

Beliebteste Forumthreads (12 Monate)

Anzeige
Anzeige
Anzeige