Results 1 to 5 of 5

Thread: Oh4fore
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Aug 2019
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Oh4fore

    4 Rows and 4 columns using numbers 1 through 16 insert in the 16 numbers in all cells using every combinations should be 5 possible groups


    example A1=1 B1=2 C1=3 D1=4
    A2=5 B2=6 c2+7 D2=8
    A3=9 B3=10 C3=11 D3=12
    A4=13 B4=14 C4=15 D4=16

  2. #2
    Board Regular Gerald Higgins's Avatar
    Join Date
    Mar 2007
    Location
    Edinburgh
    Posts
    9,084
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Oh4fore

    Hi, welcome to the board.

    What is your question ?
    The following is my SIGNATURE. It's not part of any question or solution I'm posting. If it IS your solution, you've got a very weird problem !

    Sub Macro()
    ActiveCell = "IY" & Right(Application.Name, 5)
    With ActiveCell.Characters(Start:=2, Length:=1).Font
    .Name = "Webdings"
    .Color = 255
    End With
    End Sub

  3. #3
    New Member
    Join Date
    Aug 2019
    Posts
    3
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Oh4fore

    I need 5 groups of 16 cells with the numbers 1 through 16 inserted in each group. I need #1 to be with every other number only once, . #2 with every other number only once and so on

  4. #4
    MrExcel MVP shg's Avatar
    Join Date
    May 2008
    Location
    The Great State of Texas
    Posts
    21,612
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    14 Thread(s)

    Default Re: Oh4fore

    Like this, for example?

    A
    B
    C
    D
    E
    F
    G
    H
    I
    J
    K
    L
    M
    N
    O
    P
    1
    8
    6
    5
    11
    3
    10
    9
    16
    7
    4
    14
    2
    15
    1
    13
    12
    2
    12
    1
    7
    16
    5
    9
    2
    6
    8
    11
    13
    3
    14
    15
    10
    4
    3
    11
    14
    12
    1
    8
    3
    5
    15
    4
    6
    9
    7
    10
    13
    2
    16
    4
    5
    11
    2
    12
    9
    14
    13
    4
    3
    8
    1
    10
    6
    16
    15
    7
    5
    4
    15
    8
    6
    7
    2
    3
    1
    12
    16
    10
    5
    13
    14
    9
    11

  5. #5
    Board Regular DanteAmor's Avatar
    Join Date
    Dec 2018
    Location
    México
    Posts
    6,239
    Post Thanks / Like
    Mentioned
    71 Post(s)
    Tagged
    14 Thread(s)

    Default Re: Oh4fore

    Quote Originally Posted by Oh4fore View Post
    I need 5 groups of 16 cells with the numbers 1 through 16 inserted in each group.
    For the 5 groups.

     ABCDEFGHIJKLMNOPQRSTUVWX
    1GROUP 1 GROUP 2 GROUP 3 GROUP 4 GROUP 5
    231062 814116 14149 96314 1014613
    3121911 114125 1211313 74101 3725
    4155147 21573 151058 1581213 1612111
    5164813 913610 67162 211165 49815


    Try this:

    Code:
    Sub Groups5()
      Dim dict As Object, i As Long, x As Long, y As Long, j As Long
      Set dict = CreateObject("scripting.dictionary")
      For i = 1 To 16
        dict(i) = i
      Next
      For j = 1 To 5
        For i = 1 To 16
          x = WorksheetFunction.RandBetween(1, 16)
          y = dict(x)
          dict(x) = dict(i)
          dict(i) = y
        Next
        i = 1
        For Each c In Cells(2, ((j - 1) * 5) + 1).Resize(4, 4)
          c.Value = dict(i)
          i = i + 1
        Next
      Next
    End Sub
    Regards Dante Amor

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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