Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8994053
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:20:10+00:00 2026-06-15T23:20:10+00:00

I got some excel sheets where user has to insert list of data on

  • 0

I got some excel sheets where user has to insert list of data on sheet2.
Then user hit a button and sheet1 is updated based on the data insertes in sheet2.

This code will find if data in sheet2 is missing in sheet and then insert the data correctly.
I also need to have existing records opdated.
Existing data on sheet1 has been added manuel columns with comments, these comments should not be deleted on data update.

Data on sheet1 is located from C to N column – key is located in J.

    Dim iLast As Long
Dim iCounter As Integer

iLast = Sheets(2).Range("I" & Application.Rows.Count).End(xlUp).Row

Dim rng As Range

For iCounter = 2 To iLast
    Set rng = Sheets(1).Range("J:J").Find(Sheets(2).Range("I" & iCounter).Value)

    If rng Is Nothing Then
        Sheets(2).Range("B" & iCounter & ":" & "M" & iCounter).Copy
        Sheets(1).Range("C" & Sheets(1).Range("J" & Application.Rows.Count).End(xlUp).Row + 1).PasteSpecial xlPasteAll
        Range("B2").Select

        'Insert mailto link
        Selection.Copy
        Sheets(1).Range("B" & Sheets(1).Range("J" & Application.Rows.Count).End(xlUp).Row).Select
        'Range("B3").Select
        ActiveSheet.Paste
        ActiveSheet.Paste
        Application.CutCopyMode = False
    Else

    'MsgBox "update existing row with new data - how to"

    End If

Next iCounter 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:20:11+00:00Added an answer on June 15, 2026 at 11:20 pm

    You should be able to do it in a similar way to adding a new line.

    If you use xlPasteValues instead of xlPasteAll the comments in Sheet 1 should not be affected.

    Assuming that your just copying the values and there’s no extra formatting or comments to be copied across.

    I’m not exactly sure what your trying to achieve which makes it a little more difficult for me, but I think this is what you are trying to do?

    Dim iLast As Long
    Dim iCounter As Integer
    
    iLast = Sheets(2).Range("I" & Application.Rows.Count).End(xlUp).Row
    
    Dim rng As Range
    
    For iCounter = 2 To iLast
        Set rng = Sheets(1).Range("J:J").Find(Sheets(2).Range("I" & iCounter).Value)
    
        If rng Is Nothing Then
            Sheets(2).Range("B" & iCounter & ":" & "M" & iCounter).Copy
            Sheets(1).Range("C" & Sheets(1).Range("J" & Application.Rows.Count).End(xlUp).Row + 1).PasteSpecial xlPasteAll
            Range("B2").Select
    
            'Insert mailto link
            Selection.Copy
            Sheets(1).Range("B" & Sheets(1).Range("J" & Application.Rows.Count).End(xlUp).Row).Select
            'Range("B3").Select
            ActiveSheet.Paste
            ActiveSheet.Paste
            Application.CutCopyMode = False
        Else
            Sheets(2).Range("B" & iCounter & ":" & "M" & iCounter).Copy
            Sheets(1).Range("C" & rng.Row).PasteSpecial xlPasteValues
        End If
    
    Next iCounter
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have got some excel sheet and want to fill fields automaticly with data.
I'm trying to import some data from excel into a database . i got
I wanna write some data to Excel in C# with COM, but I got
I have got some data in excel sheet id X Y 93c3ac0d-5618-42a1-8495-79c890bcc440 3,855860732 3,855888397
I've got some problems adding a excel document as attachment on a custom list.
got some problems. Built an applet that has to be used step-by-step. After each
I'm working on a C++ application to read some data from an Excel file.
I need some help with an excel command. I got two excel files, with
I've got the following problem. I've got a Excel 2010 file with n-sheets. In
I've got some Excel spreadsheets that are hitting the database pretty hard (100+ queries

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.