hello everyone,
i have got two named ranges (1 collumn, 3 to 10 rows) of the same size.
i have written a macro that goes throug a third (larger) range and writes in to a neighbouring cell everytime it encounters a value contained rangeOne of the smaller ranges.
the problem i've got is selecting the corresponding value in rangeTwo to write it in the correct cell.
example:
rangeOne_____rangeTwo
1____________200
7____________150
59___________300
62___________50
long range
1
2
3
4
5
6
7
.
.
.
59
60
61
62
an when i'm done i wont the macro to create something like this:
1_____200
2
3
4
5
6
7_____150
.
.
.
59____300
60
61
62____50
the code i've git so far writes "yes!" into the right collumn (instead of the 200,150,300,50).
how can i select the corresponding value to write into the cells?
code so far:
For i = 0 To h_top Step h_top / height_divisions
ActiveCell.Offset(1, 0).Activate
ActiveCell = i
For Each j In Range("rangeOne")
If j.Value = i Then
ActiveCell.Offset(0, 1) = "yes!"
End If
Next j
Next i
regards,
kornbrot
i have got two named ranges (1 collumn, 3 to 10 rows) of the same size.
i have written a macro that goes throug a third (larger) range and writes in to a neighbouring cell everytime it encounters a value contained rangeOne of the smaller ranges.
the problem i've got is selecting the corresponding value in rangeTwo to write it in the correct cell.
example:
rangeOne_____rangeTwo
1____________200
7____________150
59___________300
62___________50
long range
1
2
3
4
5
6
7
.
.
.
59
60
61
62
an when i'm done i wont the macro to create something like this:
1_____200
2
3
4
5
6
7_____150
.
.
.
59____300
60
61
62____50
the code i've git so far writes "yes!" into the right collumn (instead of the 200,150,300,50).
how can i select the corresponding value to write into the cells?
code so far:
For i = 0 To h_top Step h_top / height_divisions
ActiveCell.Offset(1, 0).Activate
ActiveCell = i
For Each j In Range("rangeOne")
If j.Value = i Then
ActiveCell.Offset(0, 1) = "yes!"
End If
Next j
Next i
regards,
kornbrot