Je choisis le cadre 1B se rapprochant le plus du classeur joint :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| Sub Cadre1B(Rg As Range, FICHIER$, Optional BH As Byte = 151, Optional BV As Byte = 124)
With Rg.Columns
ReDim LM&(1 To .Count)
For C& = 1 To .Count
LM(C) = .Parent.Evaluate("MAX(LEN(" & .Item(C).Address & "))")
Next
VA = .Value
End With
F% = FreeFile
Open FICHIER For Output As #F
For R& = 1 To UBound(VA)
For C = 1 To UBound(LM)
Print #F, " " & VA(R, C) & String$(LM(C) - Len(VA(R, C)) + 1, 32) _
& IIf(C < UBound(LM), Chr$(BV), "");
Next
If R = 1 Then
Print #F,
For C = 1 To UBound(LM)
Print #F, String$(LM(C) + 2, BH) & IIf(C < UBound(LM), Chr$(BV), "");
Next
End If
Print #F,
Next
Close #F
End Sub
Sub Demo1B()
Cadre1B Feuil1.Cells(1).CurrentRegion, ThisWorkbook.Path & "\Export Cadre .txt"
End Sub |
Rappel des usages de ce forum:
______________________________________________________________________________________________________
Merci de cliquer sur
pour chaque message ayant aidé puis sur
pour clore cette discussion …
Partager