+ Reply to Thread
Results 1 to 10 of 10

Copying data into a new row - macro

  1. #1
    Registered User
    Join Date
    06-09-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Copying data into a new row - macro

    Title's not that great. Not sure how to describe it well.

    What I want to do is for a macro to run and for that macro to copy data and place it in a specific place. For example i want it to take the the 20 from "Village Headquarters (Level 20)". Another time when I run the script the 20 might be a 30. I there a way to do this? To define a place to take the data from within a cell.

    My other question is, is there a way to have a macro automatically paste data one row down from the time it was run last?

    Thank you

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copying data into a new row - macro

    Where is the data to be copied from? What do yo mean by the reference to 20?

    There are several ways to get the next empty row, here's one
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    06-09-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Copying data into a new row - macro

    What I mean is i would copy Village Headquarters (Level 20) into a cell and then have the macro copy the 20 into another cell. this 20 could be another number instead of 20 but the "village headquarters" and such would stay the same.

    Would that code work as a macro as such. Like when i run the macro will it auto do that code r what.

    Sorry for my stupidity

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copying data into a new row - macro

    The example code will copy A1 from sheet2 to the next empty cell in Column A of Sheet1.

    How do you get the 20 or 30, try attaching an example workbook

  5. #5
    Registered User
    Join Date
    06-09-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Copying data into a new row - macro

    there's the document I want to put the 26 in Timber camp (Level 26) into a new row under where it says timber. But have that automatic
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    06-09-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Copying data into a new row - macro

    should I be using VBA within excel to do this or something?

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copying data into a new row - macro

    I'm still ot clear exactly what you want to do

  8. #8
    Registered User
    Join Date
    06-09-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Copying data into a new row - macro

    Sorry for the triple post. I think I'll reword what I want to do. What i want is for this:
    Village Headquarters (Level 20)
    Barracks (Level 25)
    Stable (Level 20)
    Workshop (Level 9)
    Academy (Level 1)
    Smithy (Level 20)
    Rally point (Level 1)
    Market (Level 17)
    Timber camp (Level 26)
    Clay pit (Level 26)
    Iron mine (Level 25)
    Farm (Level 30)
    Warehouse (Level 28)
    Hiding place (Level 9)
    Wall (Level 18)
    to become:

    20
    25
    20
    9
    1
    20
    1
    17
    26
    26
    25
    30
    28
    9
    18

  9. #9
    Registered User
    Join Date
    06-09-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Copying data into a new row - macro

    ^ Does that make sense? Is it possible?

  10. #10
    Registered User
    Join Date
    06-09-2009
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Copying data into a new row - macro

    Nevermind. I've figured out how to do other automated stuff so I don't need this. Thanks for trying to understand my logic +1

+ 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