+ Reply to Thread
Results 1 to 9 of 9

Need a macro to Copy Cell in Sheet1 to the next empty cell in Column A, Sheet2

Hybrid View

  1. #1
    Registered User
    Join Date
    08-16-2012
    Location
    Cleveland, TN
    MS-Off Ver
    Excel 2007
    Posts
    53

    Need a macro to Copy Cell in Sheet1 to the next empty cell in Column A, Sheet2

    Need a macro that copies cell AF6 in Sheet1
    Then pastes it into the next empty cell in Column A, in sheet 2

    Or if there is another way of doing this, please post. I am a newbie at this Excel stuff

    Here is the file: Bingo.xlsm
    Thanks
    Last edited by killerthun; 08-16-2012 at 01:15 PM. Reason: Added the spreadsheet

  2. #2
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Can this macro be created?

    If the column of data has no missing data, below will take you to the bottom of the column:
    END DOWN ARROW
    DOWN ARROW
    Click on star (*) below if this helps

  3. #3
    Registered User
    Join Date
    08-16-2012
    Location
    Cleveland, TN
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Can this macro be created?

    I'm not sure where to put those.

    I think it would be better if it the cell AF6 in Sheet1 could be copied and then pasted in the 1st empty cell in column A in Sheet2
    Is that even possible?
    I've seen some amazing things in excel and this should be cake :P

  4. #4
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Can this macro be created?

    Try this macro:

    Sub Macro1()
        Sheets("Sheet1").Select
        Application.Goto Reference:="R6C32"
        Selection.Copy
        Sheets("Sheet2").Select
        Application.Goto Reference:="R1C1"
        Selection.End(xlDown).Select
        ActiveCell.Offset(1, 0).Range("A1").Select
        ActiveSheet.Paste
    End Sub
    Last edited by jeffreybrown; 08-16-2012 at 12:31 PM.

  5. #5
    Registered User
    Join Date
    08-16-2012
    Location
    Cleveland, TN
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Can this macro be created?

    I tried that and I get "Run-time error '1004', Application-defined or object-defined error
    Not sure if it's a version issue

  6. #6
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Need a macro to Copy Cell in Sheet1 to the next empty cell in Column A, Sheet2

    Try


    Sub copy_AF6()
        Dim wsSrc   As Worksheet
        Dim wsDest  As Worksheet
        Dim Rng     As Range
        Dim LR      As Long
        
        Set wsSrc = Sheets("Sheet1")
        Set wsDest = Sheets("Sheet2")
        Set Rng = wsSrc.Range("AF6")
        
        LR = wsDest.Range("A" & Rows.Count).End(xlUp).Row + 1
        
        Rng.Copy
        wsDest.Range("A" & LR).PasteSpecial xlPasteValues
        
        Application.CutCopyMode = False
    End Sub
    HTH
    Regards, Jeff

  7. #7
    Valued Forum Contributor
    Join Date
    05-08-2012
    Location
    Georgia, USA
    MS-Off Ver
    Excel 2003, 2010
    Posts
    811

    Re: Need a macro to Copy Cell in Sheet1 to the next empty cell in Column A, Sheet2

    Try this:
    Sub Macro3()

    Sheets("Sheet1").Select
    Application.Goto Reference:="R6C32"
    Selection.Copy
    Sheets("Sheet2").Select
    Application.Goto Reference:="R1C1"
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValues
    End Sub

    It works for me
    Last edited by K m; 08-16-2012 at 12:57 PM.

  8. #8
    Registered User
    Join Date
    08-16-2012
    Location
    Cleveland, TN
    MS-Off Ver
    Excel 2007
    Posts
    53

    Re: Need a macro to Copy Cell in Sheet1 to the next empty cell in Column A, Sheet2

    Ah. Jeff, yours works like a charm. Thank you so much.
    K m, thanks also for helping me on this!

  9. #9
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,327

    Re: Need a macro to Copy Cell in Sheet1 to the next empty cell in Column A, Sheet2

    You are very welcome and thanks for the feedback

+ 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