+ Reply to Thread
Results 1 to 7 of 7

Transfer data in to varying rows?

  1. #1
    Registered User
    Join Date
    01-18-2013
    Location
    Minneapoils, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    15

    Transfer data in to varying rows?

    Hey there! I'm working on an excel program that's powered almost exclusively with buttons. That's pretty simple and I understand how to work with those, but there's one in particular that's perplexing me. I think it's possible, but it may not be. I'm guessing I'll need macros to edit my macros.

    Here's the idea -
    Once you press the button, data gets transferred from the sheet "M1" to the sheet "Master". The transferred data follows:

    (M1 to Master)
    E4 to H3
    E7 to I3
    E10 to J3
    E15 to K3
    E17 to L3
    E21 to M3
    E24 to Q3
    E27 to O3
    E30 to P3
    E37 to N3

    I4 to H4
    I7 to I4
    I10 to J4
    I15 to K4
    I17 to L4
    I21 to M4
    I24 to Q4
    I27 to O4
    I30 to P4
    I37 to N4

    M4 to H5
    M7 to I5
    M10 to J5
    M15 to K5
    M17 to L5
    M21 to M5
    M24 to Q5
    M27 to O5
    M30 to P5
    M37 to N5

    S4 to H6
    S7 to I6
    S10 to J6
    S15 to K6
    S17 to L6
    S21 to M6
    S24 to Q6
    S27 to O6
    S30 to P6
    S37 to N6

    W4 to H7
    W7 to I7
    W10 to J7
    W15 to K7
    W17 to L7
    W21 to M7
    W24 to Q7
    W27 to O7
    W30 to P7
    W37 to N7

    AA4 to H8
    AA7 to I8
    AA10 to J8
    AA15 to K8
    AA17 to L8
    AA21 to M8
    AA24 to Q8
    AA27 to O8
    AA30 to P8
    AA37 to N8

    As you can see, it follows a definite pattern. However, that's not all:

    The first time I press the button, I want the data to transfer to those cells. However, for each time after that, I want it to transfer six rows down.
    For example, AA4 to 8H would turn in to "AA4 to H14", then to "AA4 to H20", and so on.

    My end goal is for this work 70 or so times, so that would be to row 423.

    Any ideas?
    Thanks!
    Last edited by SneakyPiglet; 01-26-2013 at 10:48 AM.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Transfer data in to varying rows?

    Hi Sneaky,

    Try this:

    Please Login or Register  to view this content.
    Directions for running the routine(s) just supplied

    Copy the code to the clipboard

    Press ALT + F11 to open the Visual Basic Editor.

    Open a macro-enabled Workbook or save your Workbook As Macro-Enabled

    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code into the white space on the right

    With the cursor between Sub and End Sub press F5 (F8 to Single Step)

    OR

    Press ALT + Q to close the code window.

    Press ALT + F8 then double click on the macro name (Sneaky)
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    01-18-2013
    Location
    Minneapoils, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Transfer data in to varying rows?

    Thanks for that! It works as intended, but I've got a question for ya...

    "Once you press the button, data gets transferred from the sheet "M1" to the sheet "Master". The transferred data follows:
    (M1 to Master)"

    Would that be possible? At the very least, how would I start the process? Thanks again.



    Moderator's Note: Welcome to the forum. Please don't quote whole post, just clutter. thank you.
    Last edited by vlady; 01-22-2013 at 09:34 PM.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Transfer data in to varying rows?

    Hi Sneaky,

    If you're talking about different workbooks we'll need to alter the code. But if you put this code in the Master book - you may be able to manually activate them - it's preferable, however, to "run the directory" if they're all in the same folder???

    Please Login or Register  to view this content.
    Last edited by xladept; 01-20-2013 at 12:43 AM.

  5. #5
    Registered User
    Join Date
    01-18-2013
    Location
    Minneapoils, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Transfer data in to varying rows?

    Heya! One last question, and then I should be set.

    So I'm getting the correct transfers; I just want to move them around a bit. In the workbook "Master", I want:
    (Current Master output [in] desired Master output)
    M in K
    Q in L
    O in M
    P in N
    N in O
    K in P
    L in Q

    I looked at modifying the code myself but couldn't it to stay correct...

    Thank you!

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Transfer data in to varying rows?

    Hi Sneaky,

    If you're running from the M1 then this should put them in the new slots:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-18-2013
    Location
    Minneapoils, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    15

    Re: Transfer data in to varying rows?

    Awesome, that does exactly what I needed! Thank you.

+ 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