+ Reply to Thread
Results 1 to 2 of 2

Add a "last row in table" variable to code?

  1. #1
    Registered User
    Join Date
    07-24-2018
    Location
    California
    MS-Off Ver
    10
    Posts
    56

    Question Add a "last row in table" variable to code?

    Hi all! Me again!

    Right now, the function of the code is to go to a selected worksheet, copy data, and paste it in the main worksheet. It only works for one sheet at a time. I would like to manipulate the code so that when multiple sheets are selected, it will copy/paste data into the NEXT OPEN ROW (one data set after another).
    Currently, the first data set will go to the main page but the second will just then paste directly on top of the first.

    So here is the code I would like to manipulate: I have tried adding .Offset(1,0), .End(xlUp), etc. but I don't think I am adding it in the correct place. I know that changing the red 2 in the following is what changes where the data is pasted (2nd row in table).
    Please Login or Register  to view this content.

    And this is the rest of the code for reference:

    Please Login or Register  to view this content.
    I have attempted to add a variable that finds the next open row in the table and replace the red 2 (in the code) with said variable, but I can't figure out how to correctly write that. This is the code that I found that I tried to edit/add in but then the data just started pasting into the 5th or so row and did not pull all data in correctly.

    Please Login or Register  to view this content.

    Update if anyone was interested, we figured it out!

    Please Login or Register  to view this content.
    Last edited by sy898661; 06-07-2019 at 01:14 PM. Reason: solved, adding answer in case anyone was interested
    Thank you!!!

  2. #2
    Registered User
    Join Date
    07-24-2018
    Location
    California
    MS-Off Ver
    10
    Posts
    56

    Re: Manipulate code to paste to next open row

    I know the part of the code that tells what row to start pasting each portion in is at the end of the line

    Please Login or Register  to view this content.
    If I change that "2" to 3, it skips the first line in the table and then pastes. So I tried adding .End(xlUp) after but that produces an error. I'm not sure what the correct way to write this would be.

    is it possible without changing the rest of the code???

+ 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. match / manipulate arrays then paste back onto sheet
    By esbencito in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-08-2019, 05:30 AM
  2. Replies: 3
    Last Post: 08-31-2017, 02:25 PM
  3. Open File And Manipulate
    By ajocius in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2014, 03:12 AM
  4. for each cell in range in wb1 manipulate string & paste to wb2 diff col same row
    By supermacBT in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-06-2013, 12:44 PM
  5. Replies: 2
    Last Post: 01-09-2013, 08:57 PM
  6. Open, copy and paste VBA code
    By arthenian11 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-08-2012, 05:36 AM
  7. open and manipulate embedded word documents from excel?
    By mcledavid in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-21-2009, 04:24 PM

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