I have an excel file with 2 worksheets.
- In worksheet 1 i want to end up with a list of all the cells in worksheet 2 that are 12 digits long and the cell on the right of those.
- I want the actual cell (the one with 12 digits) in (lets say)
I1
on my worksheet 1, and the value next to it (on the right) inI2
.
I thought/assumed i could do this with a loop to check what cells are 12 digits long but i kinda got lost.
After some more searching i came up with this:
Sub check()
Dim rng As Range, cell As Range
Set rng = Range("A1:P35")
For Each cell In rng
If Len(cell) = 12 Then
cell.Copy Destination:=Sheet2(s).Rows(K)
Row = K + 1
End If
Next cell
End Sub
Would this idea work? I just havent figured out yet how to actually copy the found cell into the other worksheet.