Results 1 to 8 of 8

Copy data and paste it to next sheet with conditions

Threaded View

  1. #1
    Forum Contributor HaroonSid's Avatar
    Join Date
    02-28-2014
    Location
    india
    MS-Off Ver
    Excel 2013
    Posts
    2,095

    Post Copy data and paste it to next sheet with conditions

    hi,
    I am using below code to copy paste data one sheet to next sheet

    [/Option Explicit
     
    Sub CopyRow()
    Call CopyFormulaAndPasteAsValue
        Dim lastrowSrc As Long
        Dim lastrowDest As Long
         
        lastrowSrc = Sheets("sheet1").Range("c" & Rows.Count).End(xlUp).Row
         
        lastrowDest = Sheets("sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
         
         'Copy row
        Sheets("sheet1").Range("A7:i" & lastrowSrc).EntireRow.Copy Sheets("sheet2").Range("A" & lastrowDest)
         
    End Sub
    "sheet1" range A7:A have unique number ( like 1-100000000)
    if from sheet1.range("A7:A"), any number found in Sheet2.range.("A:A")
    then appers a msgbox with "number already added"
    if not found then
    copy paste data

    thanx
    Last edited by HaroonSid; 01-02-2017 at 12:25 PM.
    Use Code-Tags for showing your code :
    Please mark your question Solved if there has been offered a solution that works fine for you
    If You like solutions provided by anyone, feel free to add reputation using STAR *

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 6
    Last Post: 03-26-2014, 11:40 PM
  2. Macro to copy the data from sheet1 and to paste it in sheet2 with conditions.
    By Thinker8 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-17-2014, 09:55 AM
  3. [SOLVED] Copy And Paste on Another Sheet ( next time paste data from empty row )
    By HaroonSid in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-17-2014, 02:29 AM
  4. [SOLVED] Copy paste the data with no negative using the conditions
    By tharindudk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-16-2013, 08:01 PM
  5. Copy Data from One sheet to other in same excel with some conditions.
    By Taj48 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-07-2013, 02:03 PM
  6. [SOLVED] Bulk import. (Copy Data from one sheet to a main sheet with conditions)
    By DanzaNZ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-18-2013, 12:24 AM
  7. Replies: 2
    Last Post: 02-22-2011, 02:07 AM
  8. [SOLVED] copy data from one sheet to another under conditions
    By nico in forum Excel General
    Replies: 5
    Last Post: 05-31-2005, 01:05 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