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

  • SEARCH
  • Home
  • 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 6136781
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:38:41+00:00 2026-05-23T17:38:41+00:00

So, in a Workbook, I have two worksheets: One has a table full of

  • 0

So, in a Workbook, I have two worksheets: One has a table full of ideas which is linked to an SQL database, and the other will have certain ideas selected from that table.

From the database table, I want to copy ideas that meet specific criteria to a second table. There they will be given certain numerical rankings by the user

Idea 1    0    4    5    3    8
Idea 2    7    5    1    5    4
Idea 3    1    2    8    8    2

Upon the clock of an included button, i want to update the database table, and copy over any NEW ideas into the ratings table, so that it may resemble the following.

Idea 1    0    4    5    3    8
Idea 2    7    5    1    5    4
Idea 3    1    2    8    8    2
New Idea1  
New Idea2  

How can I accomplish this copying? I can’t imagine a way to do this without overwriting the already included ratings.

Code

Code used to copy all ID numbers to rating table.

Sub CopyFilter()

Dim rng As Range
Dim rng2 As Range

With ActiveSheet.AutoFilter.Range
    On Error Resume Next
        Set rng2 = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
            .SpecialCells(xlCellTypeVisible)
    On Error GoTo 0
End With

If rng2 Is Nothing Then
    MsgBox "No data to copy"
Else
    Set rng = Worksheets("Ideas").ListObjects("IdeasTable"). _
        ListColumns(1).DataBodyRange
    rng.Offset(1, 0).Resize(rng.Rows.Count - 1).Copy
    
    Worksheets("WFNs").Range("B5").PasteSpecial Paste:=xlPasteFormulas, _
    Operation:=xlNone, SkipBlanks:=False, Transpose:=False
    
End If
   
ActiveSheet.ShowAllData
Worksheets("WFNs").Activate

End Sub
  • 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-05-23T17:38:42+00:00Added an answer on May 23, 2026 at 5:38 pm

    What you have to do is, save the information about what you inserted.
    First, declare a global variable like this:

    Dim startRow as Long
    

    In your sub:

    If startRow = 0 Then
        startRow = 1 
    End If 
    
    With ActiveSheet.AutoFilter.Range
        On Error Resume Next
            Set rng2 = .Offset(startRow, 0).Resize(.Rows.Count - 1, 1) _
                .SpecialCells(xlCellTypeVisible)
        On Error GoTo 0
    End With
    

    Instead of always copying the whole range, you only copy the new entries.
    Now that you have the starting row, you can use that in your if to paste your data AFTER the old date:

    Else
        Set rng = Worksheets("Ideas").ListObjects("IdeasTable"). _
            ListColumns(1).DataBodyRange
        rng.Offset(startRow, 0).Resize(rng.Rows.Count - 1).Copy
    
        Worksheets("WFNs").Range("B" & (startRow + 4)).PasteSpecial Paste:=xlPasteFormulas, _
        Operation:=xlNone, SkipBlanks:=False, Transpose:=False
    
        startRow = rng.Rows.Count - 1
    End If
    

    I only changed rows with startRow in it. (Not tested ;))

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have an Excel workbook which has c# VSTO code in it and two
Using win32com, I have two workbooks open. How do you know which one is
I have a workbook with two sheets. The first is full of data and
I have a excel workbook with two sheets. One sheet is maxed out and
I have a workbook with two spreadsheets. One is 'Daily Profit and Loss' and
I have a workbook with two sheets. I would like to format the cell
I have around 25 worksheets in my workbook (Excel spreadsheet). Is there a way
I have two tables in my access database that I want to be able
I have a two table's ,where i have to dump the info into the
I have a workbook that has a lot of different macros in it, as

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.