copy range in respecting row

cds

Board Regular
Joined
Mar 25, 2012
Messages
84
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
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
@cds
Cross-Posting
While we do not prohibit Cross-Posting on this site, we do ask that you please mention you are doing so and provide links in each of the threads pointing to the other thread (see rule 13 here along with the explanation: Forum Rules).
This way, other members can see what has already been done in regards to a question, and do not waste time working on a question that may already be answered.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top