May 24 2019 12:05 AM
I have got a table like it is shown in a picture. I want to extract cells in a new table where the id of the column and id of the row is equally ( in this case id_row=100 and id_column=100).
May 24 2019 12:19 AM
Hi,
use this macro from my vba-tanker to do it
Sub TransferData()
Dim lngRow As Long
Dim lngRowMax As Long
Dim rngFind As Range
Dim lngZ As Long
lngZ = 1
With Sheet1
lngRowMax = .Range("A" & .Rows.Count).End(xlUp).Row
For lngRow = 2 To lngRowMax
Set rngFind = Sheet1.Rows(1).Find(what:=.Range("A" & lngRow).Value, lookat:=xlWhole)
If Not rngFind Is Nothing Then
Sheet2.Cells(lngZ, 1).Value = .Range("A" & lngRow).Value
Sheet2.Cells(lngZ, 2).Value = .Cells(lngRow, rngFind.Column).Value
lngZ = lngZ + 1
End If
Next lngRow
End With
End Sub
regards
Bernd
May 25 2019 05:11 AM
@maloks , it could be done in few steps with Power Query as attached