[VBA]
Sub S17_daily2()
Dim LastRow As Long
LastRow = Range("B65536").End(xlUp).Row
Workbooks.OpenText Filename:="C:\wip reportwk3.3.xls", Origin:=xlMSDOS, _
StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(29 _
, 1), Array(52, 1), Array(72, 1), Array(94, 1), Array(134, 1), Array(158, 1), Array(165, 1), _
Array(183, 1), Array(196, 1), Array(200, 1), Array(205, 1), Array(210, 1), Array(215, 1)) _
, TrailingMinusNumbers:=True
Columns("A:A").Delete Shift:=xlToLeft
Workbooks.Open Filename:="C:\cmo1 s17.xls", Origin:=xlWindows
Range("A9:A11142").FormulaR1C1 = _
"=VLOOKUP(RC[5],'[wip reportwk3.3.xls]wip reportwk3.3'!R12C1:R22826C13,1,0)"
Range("A9:S" & LastRow).Sort Key1:=Range("A9"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub
[/VBA]
What i am trying to do is
open wipreport, del col a,
open cm01 ,
do vlookup on
cm01 to wip ("=VLOOKUP(RC[5],'[wip reportwk3.3.xls]wip reportwk3.3'!R12C1:R22826C13,1,0)"
)
then on cm01 data sort the matches by col s
then sum up col m , totals if col s = anything beginning with B or I then give me 1 figure, then give me the remaining total of col m on the matches only ?
Dont know if this is possible
But im stuck
thanks
Merc