I have data something llike this
a b c d e f g h i j k l
1
2 1 1 1 10 21 23 32 34 43 45
3 11 2 0 22 33 44
4 12 3 1
5 19 10 8 8
6 24 6 2 2 13 20 31 35 42 46
7 25 7 3 3 14 30 36 41 47
here b2 = INT(A2/10)+MOD(A2,10) and so on till b7
c2 = abs(INT(A2/10)-MOD(A2,10)) and son on till c7
I want copy 1 to 49 numbers, if their abs(int-mod) =c2 to c7 and it will be copied across respective rows starting from f column without repeating numbers and ignoring a2 to a7. row4 will have no value since it is repeated.
I have macro like this but it cannot value in respective row
Sub LoopRange1()
'Step 1: Declare your variables.
Dim MyRange As Range
Dim MyCell As Range
Dim myrange1 As Range
Dim toadd As Boolean
n = 49
toadd = True
uniqueNumbers = 0
'Step 2: Define the target Range.
Set MyRange = Range("c2:c7")
'Step 3: Start looping through the range.
For Each MyCell In MyRange
'Step 4: Do something with each cell.
For i = 1 To n
If Abs(Int(i / 10) - i Mod 10) = MyCell.Value Then
Cells(MyCell + 1, i) = i
End If
Next i
'Step 5: Get the next cell in the range
Next MyCell
End Sub
Please guide me
a b c d e f g h i j k l
1
2 1 1 1 10 21 23 32 34 43 45
3 11 2 0 22 33 44
4 12 3 1
5 19 10 8 8
6 24 6 2 2 13 20 31 35 42 46
7 25 7 3 3 14 30 36 41 47
here b2 = INT(A2/10)+MOD(A2,10) and so on till b7
c2 = abs(INT(A2/10)-MOD(A2,10)) and son on till c7
I want copy 1 to 49 numbers, if their abs(int-mod) =c2 to c7 and it will be copied across respective rows starting from f column without repeating numbers and ignoring a2 to a7. row4 will have no value since it is repeated.
I have macro like this but it cannot value in respective row
Sub LoopRange1()
'Step 1: Declare your variables.
Dim MyRange As Range
Dim MyCell As Range
Dim myrange1 As Range
Dim toadd As Boolean
n = 49
toadd = True
uniqueNumbers = 0
'Step 2: Define the target Range.
Set MyRange = Range("c2:c7")
'Step 3: Start looping through the range.
For Each MyCell In MyRange
'Step 4: Do something with each cell.
For i = 1 To n
If Abs(Int(i / 10) - i Mod 10) = MyCell.Value Then
Cells(MyCell + 1, i) = i
End If
Next i
'Step 5: Get the next cell in the range
Next MyCell
End Sub
Please guide me