+ Reply to Thread
Results 1 to 2 of 2

cop data to respecctive group

  1. #1
    Registered User
    Join Date
    09-19-2013
    Location
    mumbai
    MS-Off Ver
    Excel 2003
    Posts
    6

    cop data to respecctive group

    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

  2. #2
    Forum Expert JLGWhiz's Avatar
    Join Date
    02-20-2011
    Location
    Florida, USA
    MS-Off Ver
    Windows 10, Excel 2013
    Posts
    2,070

    Re: cop data to respecctive group

    This is cross posted at https://www.mrexcel.com/forum/excel-...cting-row.html
    Any code provided by me should be tested on a copy or a mock up of your original data before applying it to the original. Some events in VBA cannot be reversed with the undo facility in Excel. If your original post is satisfied, please mark the thread as "Solved". To upload a file, see the banner at top of this page.
    Just when I think I am smart, I learn something new!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Group Weekly Data with Totals for that Week VBA - Group by Date
    By CHRISOK in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2017, 11:50 AM
  2. Data -> Group -> Group does not work on A Sheet
    By asjones in forum Excel General
    Replies: 3
    Last Post: 09-19-2017, 06:53 AM
  3. Replies: 14
    Last Post: 01-12-2017, 01:41 PM
  4. [SOLVED] Selecting a group of data from a larger group
    By coach.32 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-07-2016, 08:23 PM
  5. group matching and insert group of relevant data
    By kitkitkat430 in forum Excel General
    Replies: 1
    Last Post: 10-27-2015, 04:03 AM
  6. Replies: 1
    Last Post: 02-10-2014, 10:26 PM
  7. Replies: 0
    Last Post: 02-04-2013, 03:25 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1