VBA: retours à la ligne
Résolu/Fermé
honey2
Messages postés
6
Date d'inscription
jeudi 7 mars 2013
Statut
Membre
Dernière intervention
22 juillet 2013
-
Modifié par honey2 le 9/04/2013 à 15:20
honey2 Messages postés 6 Date d'inscription jeudi 7 mars 2013 Statut Membre Dernière intervention 22 juillet 2013 - 10 avril 2013 à 09:25
honey2 Messages postés 6 Date d'inscription jeudi 7 mars 2013 Statut Membre Dernière intervention 22 juillet 2013 - 10 avril 2013 à 09:25
A voir également:
- VBA: retours à la ligne
- Excel compter cellule couleur sans vba - Guide
- Mkdir vba ✓ - Forum VB / VBA
- Vba range avec variable ✓ - Forum VB / VBA
- L'indice n'appartient pas à la sélection vba ✓ - Forum Programmation
- Autofill vba ✓ - Forum Excel
2 réponses
f894009
Messages postés
17241
Date d'inscription
dimanche 25 novembre 2007
Statut
Membre
Dernière intervention
19 février 2025
1 713
9 avril 2013 à 15:58
9 avril 2013 à 15:58
Bonjour,
Si j'ai bien compris votre demande,
Bonne suite
Si j'ai bien compris votre demande,
Sub Bouton1() ' Bouton1_Cliquer Macro ' Dim fs As Object, a As Object, s2 As String, i As Integer Dim derlign As Long, lignFinal& Set fs = CreateObject("Scripting.FileSystemObject") Set a = fs.CreateTextFile("c:\test2.txt", True) i = 1 While Not IsEmpty(Cells(9, i)) While Not IsEmpty(Cells(11, i)) 'Chr(13) & Chr(10) POUR LE SAUT DE LIGNE ou vbNewLine 'chr(9) pour la tabulation ou vbTab s2 = s2 & vlan & " " & Cells(9, i) & vbNewLine & vbTab s2 = s2 & "name" & " " & Cells(10, i) & " " & vbNewLine & vbTab s2 = s2 & "ip address" & " " & Cells(11, i) & " " & Cells(12, i) & vbNewLine & vbTab s2 = s2 & "tagged" & " " & Cells(13, i) & vbNewLine & vbTab s2 = s2 & "untagged" & " " & Cells(14, i) & vbNewLine & vbTab s2 = s2 & "qos" & " " & "priority" & " " & Cells(15, i) & vbNewLine i = i + 1 Wend Wend a.WriteLine s2 a.Close End Sub
Bonne suite
honey2
Messages postés
6
Date d'inscription
jeudi 7 mars 2013
Statut
Membre
Dernière intervention
22 juillet 2013
10 avril 2013 à 09:25
10 avril 2013 à 09:25
Merci c'est magique, c'est magnifique :)