+ Reply to Thread
Results 1 to 5 of 5

copy and and pasting to first empty cell in different workbooks

  1. #1
    Registered User
    Join Date
    05-10-2014
    MS-Off Ver
    Excel 2003
    Posts
    6

    copy and and pasting to first empty cell in different workbooks

    Hello,

    I'm new to macros and need some help. I am trying to create a macro that copies cells B2 and C6 from the active worksheet in a workbook called "transfer". Then searches for the first empty cell in a worksheet called "summary" in a workbook called "report" and pastes the value from B2 in the first empty cell in column D and the value from C6 in the first empty call in column E. Any help is very much appreciated.

  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: copy and and pasting to first empty cell in different workbooks

    Hi Iwayl,

    Welcome to the Forum!

    Try this:

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

    Copy the code to the clipboard

    Open your Workbook

    Save your Workbook or Another Workbook designated for Macros as Macro_Enabled

    Press ALT + F11 to open the Visual Basic Editor.

    Select “Module” from the Insert menu

    Type "Option Explicit" then paste the code under it

    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
    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
    05-10-2014
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: copy and and pasting to first empty cell in different workbooks

    Thanks for the welcome! I tried the code and it works if there are no values in columns D and E, but it does not seem to find the next empty cell and add paste the values to those columns if there are already values in some of those columns. I am using Excel 2010. Am I doing something wrong?

  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: copy and and pasting to first empty cell in different workbooks

    Hi Iwayl,

    Try this - if it doesn't work, I'll need to see sample spreadsheets:

    Please Login or Register  to view this content.
    Last edited by xladept; 05-10-2014 at 06:47 PM.

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

    Re: copy and and pasting to first empty cell in different workbooks

    I guess it worked. Thanks for the rep!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy pasting with reference from 2 cells and several workbooks.
    By looney in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-10-2013, 11:57 AM
  2. Pasting to next empty cell
    By Hallet in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-11-2012, 11:06 AM
  3. [SOLVED] Help needed opening workbooks then copy and pasting!!
    By guydixon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2012, 12:16 PM
  4. Copy/pasting values based on a changing day (multiple workbooks)
    By evilgrinners in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-16-2012, 10:05 AM
  5. Copy data from multiple workbooks and check for dupes before pasting to master?
    By toaksie in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-23-2012, 05:10 AM

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