G
Guest
Sub SeperateData()
Dim xls as object, xlWb as object
Dim intSelrow As Integer
Dim intTotalrows As Integer
strFile = SHARE & "Data\Trans_Freight\FR7710_All_DCs_" & strBmonth & "_BY_"
& Me.txtBusYear & ".xls"
Set xls = CreateObject("Excel.Application")
Set xlWB = xls.Workbooks.Open(strFile)
intTotalrows = xls.ActiveSheet.UsedRange.Rows.Count
For intSelrow = 1 To intTotalrows
xls.cells(intSelrow, 5).select
xls.Selection.TextToColumns Destination:=xls.cells(intSelrow, 5),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(4, 1), Array(13, 1), Array(22,
1), Array(31, 1), _
Array(39, 1), Array(52, 1), Array(67, 1)), TrailingMinusNumbers:=True
Next intSelrow
Set xls = Nothing
Set xlWB = Nothing
End Sub
Dim xls as object, xlWb as object
Dim intSelrow As Integer
Dim intTotalrows As Integer
strFile = SHARE & "Data\Trans_Freight\FR7710_All_DCs_" & strBmonth & "_BY_"
& Me.txtBusYear & ".xls"
Set xls = CreateObject("Excel.Application")
Set xlWB = xls.Workbooks.Open(strFile)
intTotalrows = xls.ActiveSheet.UsedRange.Rows.Count
For intSelrow = 1 To intTotalrows
xls.cells(intSelrow, 5).select
xls.Selection.TextToColumns Destination:=xls.cells(intSelrow, 5),
DataType:=xlFixedWidth, _
FieldInfo:=Array(Array(0, 1), Array(4, 1), Array(13, 1), Array(22,
1), Array(31, 1), _
Array(39, 1), Array(52, 1), Array(67, 1)), TrailingMinusNumbers:=True
Next intSelrow
Set xls = Nothing
Set xlWB = Nothing
End Sub