+ Reply to Thread
Results 1 to 2 of 2

how to copy sheet1 to sheet2 and refresh sheet1

  1. #1
    Registered User
    Join Date
    11-12-2009
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    1

    Post how to copy sheet1 to sheet2 and refresh sheet1

    Let me explain my requirement with example.
    I have a Number of fields in Sheet 1.
    Lets say I have the below three fields in Sheet 1
    Name DOB Address
    Each time I fill in this data and I press a submit button at the bottom of the sheet 1 (which needs to be configured) the data from sheet 1 should get transferred to another sheet having the same template of fields. This second sheet would be the master sheet.
    After submitting, sheet 1 should get refreshed and the Sheet 2 should have the data.
    When I enter a second set of data and press the Submit button, the second set of data should get appended below the first set of data already present in Sheet 2.
    In the same way for next set of data and so on.
    Here is the coding

    Sub UpdateMaster( )
    Application.ScreenUpdating = False
    Range("A2:C2").Select
    Selection.Copy
    Sheets("Sheet2").Activate
    Range("A" & Rows.Count).End(xlUp).Offset(1, 0).Select
    ActiveSheet.Paste
    Application.CutCopyMode = False
    Range("A1").Select
    Sheets("Sheet1").Select
    Range("A2:C2").Value = ""
    Range("A2").Select
    End Sub
    As I have selected the range A2:C2, that particular row alone is copied and refreshed.
    If I want to copy number of rows starting from A2, let us say 1000 or 1200 rows, how can I proceed.
    Pls.help

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: how to copy sheet1 to sheet2 and refresh sheet1

    ansmyq,

    Welcome to Forum.
    Per the rules you agreed to follow, all VBA code must be wrapped in code tags. Please amend your post to apply code tags, which is easily done by highlighting all of the code then clicking on the # button.

    After you have complied with the rule for code tags, solutions will be offered.

    Thanks.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

+ 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