Clever-Excel-Forum

Normale Version: How to selectively import text into an Excel sheet?
Du siehst gerade eine vereinfachte Darstellung unserer Inhalte. Normale Ansicht mit richtiger Formatierung.
Hi There!

I am generating lots of data and would like to copy paste it into an Excel sheet. However, some part of the copied data is trash and therefore I dont want it to be added to the cells when I import the text because I would have to manually remove the "trash" in each cell.

How can I make sure that only the relevant text is being imported into the cells?

The format of the text to be copy-pasted looks like this:

1,"1GTj6KVRTUF9iSccXSFUuyZFGovWpcFKHs","5JjAiH3C9AYLBWKxnzBBNipFq64m97Gumddyu3Pe2H4yQeatBQ5"
2,"17MVWMvSmNxEyhpJMkJg7FG97WKA7dx23U","5JNVqbDs8vc7rGCnLbnpuxVt1bGQrEUopD9JHbjLSSDiuL7N3tp"
3,"1Q1d5QysdEjvs6PtSioHR87rKXJ1ZrHRNX","5JikGUNtVMbd4msy6C7biDxvzHmszY8CVJr5HwowCbu1ScEoHGd"

I would like to import the strings of letters in two horizontal cells. So for example 1st cell (A1) should contain 1GTj6KVRTUF9iSccXSFUuyZFGovWpcFKHs and the second cell (B1) should contain 5JjAiH3C9AYLBWKxnzBBNipFq64m97Gumddyu3Pe2H4yQeatBQ5

Is there a way to do this?

Thanks a lot for your help!

Best,
m4nki
Hello

- start the VBA recorder
- insert the text in the first column as you did now

- then use "Data", "Text to columns" (i don't now the exact wording / in german Excel it is "Daten", "Text in Spalten")
 = use komma as separator
 = and Textqualifier "
- the first column(1,2,3,...) you can disable in the second step (do not import)
- ...


After that stop the recorder and edit the code


LG UweD
Halò!
Tha mi den bheachd gum faodadh eadar-theangair a chleachdadh ann am fòram le Gearmailtis.

Beannachdan Ralf
Moin

Er zouden ook ergens een paar Engelstalige forums moeten zijn.

Doei.
Fora vind ik mooier in het Nederlands.


Assume the file that contains the data you want to import is "G:\OF\example.csv"
Use:


Code:
Sub M_snb()
   sheets.add , sheets(sheets.count),,"G:\OF\example.csv"
End Sub
Leute....


Ihr programmiert hier in VBA

Das ist sowieso englisch.

Ich denke jeder hat in der Schule diese Sprache gelernt.


Außerdem spricht es für die Qualität DIESES Forums, wenn sogar über die Grenze hinaus hier um Hilfe gebeten wird.


Greetings from UweD
(17.03.2020, 09:01)UweD schrieb: [ -> ]Außerdem spricht es für die Qualität DIESES Forums, wenn sogar über die Grenze hinaus hier um Hilfe gebeten wird.

Was hat die Syntax einer Programmiersprache mit der Kenntnis einer praktizierten Sprache eines Forums zu tun?

Ich habe auch bereits Verbesserungsvorschläge an MS gesandt, niemals jedoch wäre ich auf die Idee gekommen, dies in Deutsch zu kommunizieren, weil ich mich den Gepflogenheiten der Plattform angepasst habe (hat etwas mit Kinderstube zu tun)!

Einem Thread-Ersteller, der es noch nicht mal für nötig erachtet, auf Antworten zu reagieren, zu unterstellen, dass er CEF aufgrund der Qualität der Antworten ausgewählt hat, zeugt von einer imo unfassbaren Blauäugigkeit von Dir, Uwe!
Was m4nki kann, ist, nach excel forum zu suchen; prima!

Und jetzt darfst Du Dich wieder in der (nur) von Dir angenommenen Akzeptanz suhlen.

(ich freue mich bereits jetzt auf das Eingreifen der Moderation)
Hi,

zumindest einer der Moderatoren ist der Meinung, dass die "Amtssprache" in einem deutschen Forum auch Deutsch ist.
Wieso Deutsch ? :16:

Clever ? 

Excel ?

Forum ?