countryfan_n
03-09-2008, 02:30 AM
Hello friends,
Please help me, the below code picks up data once the condition is met, trouble is it is picking up text also, i only want it to pick the numeric data.
please see the bolded part
Ofcourse thanks in advance,
Nawaf
Sub ACTIVE()
Dim ii As Integer
Dim CW As Worksheet 'consolidation worksheet
Set CW = Sheets("ACL")
Const FC As Integer = 3 'first column
Const LC As Integer = 18 'last column
For Each cell In Sheets("WS").Range(Sheets("WS").[A14], Sheets("WS").[A65536].End(xlUp))
With Sheets(cell.Value)
For I = 2 To 1000
If .Cells(I, 13) > 0 Then
.Range(.Cells(I, FC), .Cells(I, LC)).Copy
CW.Cells(16, FC).Offset(ii).PasteSpecial xlValues
Application.CutCopyMode = False
CW.Cells(16, "T").Offset(ii) = .Cells(2, "O")
CW.Cells(16, "S").Offset(ii) = .Cells(4, "O")
ii = ii + 1
End If
Next I
End With
Next
End Sub
Please help me, the below code picks up data once the condition is met, trouble is it is picking up text also, i only want it to pick the numeric data.
please see the bolded part
Ofcourse thanks in advance,
Nawaf
Sub ACTIVE()
Dim ii As Integer
Dim CW As Worksheet 'consolidation worksheet
Set CW = Sheets("ACL")
Const FC As Integer = 3 'first column
Const LC As Integer = 18 'last column
For Each cell In Sheets("WS").Range(Sheets("WS").[A14], Sheets("WS").[A65536].End(xlUp))
With Sheets(cell.Value)
For I = 2 To 1000
If .Cells(I, 13) > 0 Then
.Range(.Cells(I, FC), .Cells(I, LC)).Copy
CW.Cells(16, FC).Offset(ii).PasteSpecial xlValues
Application.CutCopyMode = False
CW.Cells(16, "T").Offset(ii) = .Cells(2, "O")
CW.Cells(16, "S").Offset(ii) = .Cells(4, "O")
ii = ii + 1
End If
Next I
End With
Next
End Sub