PDA

View Full Version : [SOLVED:] COPY/PASTE SPECIFIC DATA INTO GROUPS ON NEW SHEET



branston
05-26-2020, 10:10 AM
Hi

Not having any joy with this so really hoping someone can help please.

I have a list of candidates with some associated data which I need to

1. copy data from 'candidates' tab
2. paste and sort into 4 groups

using VBA.

The number of candidates can change so the table in the 'groups' tab needs to be able to "extend" itself.

The candidate data (tab 2) itself is displayed in 2 parts (Columns B to D and Columns H to J). Ideally, once grouped into the relevant section, I need to distinguish between these 2 sets of groups. At the moment I have just used two colours (Orange Group and Blue Group).

I have attached my ***DUMMY DATA*** sheet and on the first tab I have shown part of how the end result should look like.

Can anyone help please?

Many thanks in advance.

Kenneth Hobs
05-29-2020, 08:16 AM
Your first two data rows/records in Data sheet are groups 1 and 2. In candidates sheet, they are both in blue group. The group color then does not correlate to group number.

First off, you could make your task much easier if you named the pictures with the unique ID or their name.

When sorting, you have to designate what field(s)/column(s) to sort by and order by descending or ascending. If you go by name, it will sort by first name. This is why most people set up databases with multiple fields to build a name like First, Middle, Last and then they can build the name and sort by Last and then First or such. ID (admin) field might be another field to sort by.

branston
05-29-2020, 02:01 PM
Hi Ken

Thanks for the reply.

I had initially just uploaded some dummy data and to give an idea of what each section should look like. I have amended it again so hopefully it's a bit clearer.

I have managed to loop through and give each candidate a unique name. I am however at a loss as how to now get these pics/data across onto sheet2 into the correct 'group' section. If I was just copy/pasting all data into four columns (on sheet2) the task may be easier, but the 2x2 grid format is making it difficult. I am now resigned into thinking that I should use four columns instead (but it's not what I really want).

I'd appreciate it if you could take a look at my updated sheet and any help/pointers would be gracefully received.

Huge thanks

branston
05-30-2020, 03:56 AM
Hi Ken

Made a little more progress so have uploaded my sheet again. If you get a chance please take a look.

Many thanks

branston
05-31-2020, 12:49 PM
Attempting to try to solve this in a slightly different way. Think I am nearly there but having an issue with named ranges. Was hoping someone could take a look and help please? (Latest updated file attached as couldn't edit previous post)