+ Reply to Thread
Results 1 to 8 of 8

Change active cell when pasting date from another workbook

  1. #1
    Registered User
    Join Date
    01-17-2013
    Location
    Durham, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Change active cell when pasting date from another workbook

    Hi,

    New to VBA so sorry if this is a simple question!

    I have a spreadsheet with VBA that opens up other files (i select), copies one in & closes the file, then opens the next one up and pastes that underneath the first set, closes it and so on. My active cell always seems to be A1 but i want it to change to be the column A of the last row that data was pasted in (+1)

    Code so far is

    Please Login or Register  to view this content.
    Any help is appreciated!
    Last edited by arlu1201; 04-12-2013 at 04:32 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Change active cell when pasting date from another workbook

    your code works on my test wb.
    what is wsMstr ? attach the 2 files for testing, include a sheet with desired result
    Last edited by patel45; 04-11-2013 at 07:35 AM.
    If solved remember to mark Thread as solved

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Is there any data in column A?
    If posting code please use code tags, see here.

  4. #4
    Registered User
    Join Date
    01-17-2013
    Location
    Durham, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Change active cell when pasting date from another workbook

    Quote Originally Posted by patel45 View Post
    your code works on my test wb.
    what is wsMstr ? attach the 2 files for testing, include a sheet with desired result
    In the 2 files (there will be more, & there will be thousands more rows than in the examples) there is header information that i need to be copied into a column on the main sheet next to all the data. If i can get it to recognise the first cell in the new set of data each time as the active cell, i can use that to copy the relevant data and paste to the side and then i can delete the header information as it will be at the side (hope this makes sense!)
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Change active cell when pasting date from another workbook

    what is the master sheet ?

  6. #6
    Registered User
    Join Date
    01-17-2013
    Location
    Durham, England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Change active cell when pasting date from another workbook

    The master sheet is the one that will end up having all the data from the various sheets in it. The file with the code in
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Change active cell when pasting date from another workbook

    Please Login or Register  to view this content.

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Change active cell when pasting date from another workbook

    JBlam,

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. In order to put code tags, either type [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] at the end of it, OR you can highlight your code and click the # icon at the top of your post window.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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