+ Reply to Thread
Results 1 to 5 of 5

Copy data to other sheet + Loop to last record

  1. #1
    Forum Contributor
    Join Date
    01-18-2009
    Location
    Montreal
    MS-Off Ver
    MS Office 2016
    Posts
    111

    Question Copy data to other sheet + Loop to last record

    Good Day,

    Would require your assistance if you can help me out with the below inquiry as I'm unable to find a possible simple solution...

    I have SQL data that I'm extracting and populating two sheets accordingly on daily basis. (This is done manually and sheets are refreshed with new data)

    Name of tabs: (Peaked & Confirmed)

    Each sheet consist obviously of different data but table extract contains the same name & number of columns.

    Name & Number of Columns :
    1. Org_province
    2. Port_Of_Load
    3. Port_Of_Discharge
    4. BK_Client_Name
    5. FF_BK_Name
    6. VesselVoyage
    7. GrossWeight
    8. Export_Closing_Date_Yard
    9. Sail_Date
    10. SailWeek
    11. SailMonth
    12. Sailing_Year
    13. RevenueTotal

    Macro Requirement: (Need your help)

    Data to be extracted based on the following existing Master sheets from same Excel file:

    Example:
    • Peak Data would move to MasterPeak
    • Confirmed Data would move to MasterConfirmed

    Now my concern is that Master sheets would have to keep all records. How can a I ensure that when macro is automatically populating sheets it doesn't override records already existing and loops only to the last empty cell and populates columns from the point on?

    I would appreciate your assistance if possible.
    Last edited by jantonio; 01-12-2010 at 04:00 PM. Reason: Spelling

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: Copy data to other sheet + Loop to last record

    There are several ways to get to the end of the data on a given worksheet. My favorite wayis to use the UsedRange property of the Worksheet object. If ws is your worksheet, then
    Please Login or Register  to view this content.
    is the next row after all of the current data.

  3. #3
    Forum Expert Domski's Avatar
    Join Date
    12-14-2009
    Location
    A galaxy far, far away
    MS-Off Ver
    Darth Office 2010
    Posts
    3,950

    Re: Copy data to other sheet + Loop to last record

    This any good?

    Please Login or Register  to view this content.
    It assumes you have headings on both sheets. Just change the sheet names to work on the other sheets.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  4. #4
    Forum Contributor
    Join Date
    01-18-2009
    Location
    Montreal
    MS-Off Ver
    MS Office 2016
    Posts
    111

    Re: Copy data to other sheet + Loop to last record

    Thank you both.

    I will further test and ensures it works properly.

  5. #5
    Forum Contributor
    Join Date
    01-18-2009
    Location
    Montreal
    MS-Off Ver
    MS Office 2016
    Posts
    111

    Re: Copy data to other sheet + Loop to last record

    Dom,

    Your formula works as requested!

    Thread Solved!

+ 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