VBA: retours à la ligne
Résolu honey2 Messages postés 6 Date d'inscription Statut Membre Dernière intervention -
honey2 Messages postés 6 Date d'inscription Statut Membre Dernière intervention - 10 avril 2013 à 09:25
honey2 Messages postés 6 Date d'inscription Statut Membre Dernière intervention - 10 avril 2013 à 09:25
A voir également:
- VBA: retours à la ligne
- Excel compter cellule couleur sans vba - Guide
- Forum VB / VBA
- Forum Excel
- Forum Programmation
- Forum VB / VBA
2 réponses
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