rollingzep
Board Regular
- Joined
- Nov 18, 2013
- Messages
- 223
- Office Version
- 365
- Platform
- Windows
I am trying to populate values on AK in ws TSS Trans, with S&P values from sheet, China by comparing AL with Ccode.
based on
This is my code, I am getting Subscript out of range error, at Chk line
<CODE>
LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row
ws.Range("AK2:AK" & LastRow).Clear
With Sheets("TSS Trans").Cells(1).CurrentRegion.Resize(, 37)
Data = .Value
With Sheets("China").Cells(1).CurrentRegion
For i = 2 To UBound(Data)
Chk = Application.Match(Data(i, 38), .Columns(6), 0)
If Not IsError(Chk) Then Data(i, 37) = .Cells(Chk, 3)
Next i
End With
.Value = Data
End With
</CODE>
based on
This is my code, I am getting Subscript out of range error, at Chk line
<CODE>
LastRow = ws.Range("A" & Rows.Count).End(xlUp).Row
ws.Range("AK2:AK" & LastRow).Clear
With Sheets("TSS Trans").Cells(1).CurrentRegion.Resize(, 37)
Data = .Value
With Sheets("China").Cells(1).CurrentRegion
For i = 2 To UBound(Data)
Chk = Application.Match(Data(i, 38), .Columns(6), 0)
If Not IsError(Chk) Then Data(i, 37) = .Cells(Chk, 3)
Next i
End With
.Value = Data
End With
</CODE>