Ftwtreefiddy
New Member
>>> use code - tags <<<
Using this to print a text file with fixed spacing but I need to make it so column C(3) will extract the text from the right not the default left?? Anytime I've tried to add the Right function this is an exapmle :
Or anything similar I get an error?
Code:
Sub ExportFixedLength1()
Dim A As String * 30, B As String * 25, C As String * 20, D As String * 15, E As String * 10
Dim FF%, Rg As Range
FF = FreeFile
Open ThisWorkbook.Path & "\ExportFL 1 .txt" For Output As #FF
For Each Rg In ActiveSheet.UsedRange.Rows
A = Rg.Cells(1).Text
B = Rg.Cells(2).Text
C = Rg.Cells(3).Text
D = Rg.Cells(4).Text
E = Rg.Cells(5).Text
Print #FF, A; B; C; D; E
Next
Close #FF
End Sub
Code:
Dim Myvalue As String
Dim Myvalue
Myv = Right(C, 20)
Last edited by a moderator: