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 8139185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:44:28+00:00 2026-06-06T11:44:28+00:00

I have a sheet A that looks something like this: Name Phone Number Title

  • 0

I have a sheet A that looks something like this:

Name     Phone Number  Title         Id
Ron      08900108      Carpenter     440
Bob      48951230      Painter       830
Ron      14890560      Carpenter     561
Steve    98023023      Carpenter     112

and another sheet called Carpenter (and another called Painter on the same formatting)

Name     Phone Number  Id     Comment
Ron      08900108      440    Cool dude
Bob      48951230      830    Less Awesome Dude

I want to copy the rows of A to the sheets called Carpenter and Painter, putting the Name, Phone Number on the same line as the existing ID (if someone has changed number for example) or add a new line if it is a new id. I want to keep the exising comments.

Since I have no experience whatsoever in VBA, you can help me by either providing the code solving the problem or hints on what functions(?) and other language constructs to use and where I can find information about them.

I guess I need to iterate over the rows in A and copying it into an array which I send to the correct sheet in some way.

  • 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-06T11:44:31+00:00Added an answer on June 6, 2026 at 11:44 am

    First of all, consider the fact that you are using Excel for operations that are typically database related and can easily be done using Access.
    I notice more and more the fact that Excel is being used as a datasheet. While in some circumstances this may be practical, let’s not forget that the main function of Excel is a spreadsheet and NOT a database.

    If you still insist on doing this in Excel, there are many ways to do this:

    1) Load the source range into an array, as well as the destiny range. Start comparing the two loaded arrays and perform operations at will; When needing to set a new id, you can extend the array dynamically and use ubound(array) to retrieve the size of the array. You can also set the range dynamically using the size of your array as input parameter. Up to you to figure out how it needs to be done for your case.

    2) Create a custom self sustaining class for each sheet that returns a dictionary of instances representing the records. Dictionaries allow key property-usage. This can also be the base for further manipulations. It may seem as a rather weird way, but it works but I wouldn’t use it for a mass amount of data).
    Benefit is that this class is rather flexible and can easily be called again later on with very limited code.

    3) Use ADODB to perform queries on the sheets (don’t forget to reference the library). ADODB allows you to treat an Excel sheet as table where the first row of the sheet is considered as field header.

    Any of these methods would eventually work but you’re making it hard on yourself.
    As I said, Access if far better at this because you can create a relational table based on foreign keys.
    If you need these data in Excel, it is not a problem since you can still create a connection between Excel – Access using ADO.

    Sorry to put this as a reply, but since I’m not often on Stack Overflow, I cannot post comments.
    Although I cannot write the code for you, I hope this may help you on the way.

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

Sidebar

Related Questions

I have a form that looks something like this: <form id=uploadForm name=uploadForm method=post enctype=multipart/form-data>
I have excel sheet that looks something like this.. A B C ...K.....P Q
So currently, I have an ArrayList that looks something like: [ [id, type, name,
I'm having trouble figuring this out, I have an xml sheet that looks like
I have the this code that will create excel file and work sheet then
Really simple question: Am I missing something? Seems like this should be all that
Update: sample file sample workbook Problem : I would like to have something that
I have an excel sheet that has several headers. One of the header is
I have an excel sheet that I want to load into a datatable withe
I have an excel sheet that is organized as follows: COL1 COL2 1 30

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.