+ Reply to Thread
Results 1 to 2 of 2

Copy Data from Column to block... snake style!

  1. #1
    Registered User
    Join Date
    04-21-2010
    Location
    Aachen, Germany
    MS-Off Ver
    Excel 2007
    Posts
    1

    Copy Data from Column to block... snake style!

    Hi guys,

    im pretty much a newbie in VBA programming and i got stuck with something i just cant handle, so I need urgent help.
    Here's the situation:

    I get a column of data and I want to transform it into a block of definable width. (with a message box - i got that to work at least). The idea is that the program copies the data cell by cell untill the end width of the block is reached, the jumps to the next line and continues copying backwards... and then repeat till all the data in the original column is gone through - like a snake.

    kinda like this (example for width= 4 and 14 values in the original column)

    1 2 3 4
    8 7 6 5
    9 10 11 12
    14 13

    With my (very narrow knowledge) I get to the end of the first row using this:

    Sub Test01()
    '
    Dim i_end As Integer
    Dim i As Integer

    i_end = InputBox("Anzahl der Blockspalten eingeben:")

    MsgBox ("i_end = " & i_end)

    For i = 1 To i_end
    Cells(1, i).Value = Cells(i, 1).Value

    Next i

    End Sub


    But I have no idea how to work in the rest of the requirements. Please help me!!


    Thanks people!

    Karl

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,485

    Re: Copy Data from Column to block... snake style!

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    Post a workbook with sample data in both the before and after layouts.

    It may help if you explain why you are doing this
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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