Hi guys, I need to insert the pending value with the table like this:
And insert value to this:
I have found this code:
The code works great inserting all the values but except the "Pending"
Thank's in advanced
And insert value to this:
I have found this code:
VBA Code:
Sub Test1()
Dim row As Long, col As Long
Dim cell As Range, data As Range
Dim rangeFound As Range, rngResult As Range
Dim ws1 As Worksheet, ws2 As Worksheet
Set ws1 = ActiveWorkbook.Sheets("Sheet1")
Set ws2 = ActiveWorkbook.Sheets("Sheet2")
Set rngData = ws1.Range("B2", ws1.Cells(Rows.Count, "B").End(xlUp))
Sheets("Sheet1").Range("A3:C103").Copy Sheets("Sheet2").Range("A2")
Worksheets("Sheet2").Columns("A:BA").AutoFit
For Each cell In data
Select Case cell
Case ""
Select Case True
Case cell.Offset(0, -1) Like "Experiment *"
col = CLng(Trim(Split(cell.Offset(0, -1), "Experiment ")(1))) + cell.Column + 1
ws2.Cells(1, col) = cell.Offset(0, -1)
End Select
Case Else
Set rngResult = ws2.Range("B2", ws2.Cells(Rows.Count, "B").End(xlUp))
If rngResult.row = 1 Then Set rngResult = ws2.Range("B2")
Set rangeFound = rngResult.Find(cell.Value, LookAt:=xlWhole)
If rangeFound Is Nothing Then
With ws1.Range("C1:C103")
.Offset(, 5).Value = Evaluate("if(isnumber(match(" & .Address & ",{""Sym""Total esult",""},0)),""pending"","""")")
End With
Else
With ws2.Cells(rangeFound.row, col)
.Value = cell.Offset(0, 2)
End With
End If
End Select
Next
End Sub
The code works great inserting all the values but except the "Pending"
Thank's in advanced