Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default Array/Lookups, etc...

Hi,

I'm trying to create a formula for the following senario...

I have a table of people (by row) who are progressing through the first part
of some training (worksheet 1) and I have a second table (worksheet 2) with
further training for those people who pass the first part.

I want the details of the people who pass to automatically populate the
second sheet but without blank rows, i.e. if numbers 1, 2, 4 & 8 pass from
sheet one (the column J cells show "Yes") I need them to appear in rows 1, 2,
3 & 4 on sheet 2.

However, there is a further €˜issue...

I have found a formula that moves the names nicely but if, for example,
learner number 5 passes their test, they're details are moved over to the
second sheet and further information is recorded in the columns alongside
them.

However, if learner 4 then passes, their details are 'inserted' into the
second sheet above 5, so 5's 'further details' become 4's...

Any thoughts or ideas?...

Thank you!

Jayjay

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default Array/Lookups, etc...

I have some VBA code which will help BUT it requires a field (numeric ID?) in
Sheet1 which is unique to each person and that the sheet is sorted on this
field.

Let me know is this would be useful.

"Jayjay" wrote:

Hi,

I'm trying to create a formula for the following senario...

I have a table of people (by row) who are progressing through the first part
of some training (worksheet 1) and I have a second table (worksheet 2) with
further training for those people who pass the first part.

I want the details of the people who pass to automatically populate the
second sheet but without blank rows, i.e. if numbers 1, 2, 4 & 8 pass from
sheet one (the column J cells show "Yes") I need them to appear in rows 1, 2,
3 & 4 on sheet 2.

However, there is a further €˜issue...

I have found a formula that moves the names nicely but if, for example,
learner number 5 passes their test, they're details are moved over to the
second sheet and further information is recorded in the columns alongside
them.

However, if learner 4 then passes, their details are 'inserted' into the
second sheet above 5, so 5's 'further details' become 4's...

Any thoughts or ideas?...

Thank you!

Jayjay

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default Array/Lookups, etc...

This would be brilliant - all of the Learners already have individual
(unique) 'Learner Numbers'.

Thank you.

Jayjay

"Toppers" wrote:

I have some VBA code which will help BUT it requires a field (numeric ID?) in
Sheet1 which is unique to each person and that the sheet is sorted on this
field.

Let me know is this would be useful.

"Jayjay" wrote:

Hi,

I'm trying to create a formula for the following senario...

I have a table of people (by row) who are progressing through the first part
of some training (worksheet 1) and I have a second table (worksheet 2) with
further training for those people who pass the first part.

I want the details of the people who pass to automatically populate the
second sheet but without blank rows, i.e. if numbers 1, 2, 4 & 8 pass from
sheet one (the column J cells show "Yes") I need them to appear in rows 1, 2,
3 & 4 on sheet 2.

However, there is a further €˜issue...

I have found a formula that moves the names nicely but if, for example,
learner number 5 passes their test, they're details are moved over to the
second sheet and further information is recorded in the columns alongside
them.

However, if learner 4 then passes, their details are 'inserted' into the
second sheet above 5, so 5's 'further details' become 4's...

Any thoughts or ideas?...

Thank you!

Jayjay

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default Array/Lookups, etc...

Try this:

Match is on an "ID" in column A and MUST be in ascending order.

If there are any problems, post sample w/book to:

toppers at REMOVETHISjohntopley.fsnet.co.uk


Sub Transfer1_2()

Dim ws1 As Worksheet, ws2 As Worksheet
Dim lastrow1 As Long, lastrow2 As Long
Dim inrow2 As Long
Dim rng2 As Range

Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")


With ws2
lastrow2 = .Cells(Rows.Count, "A").End(xlUp).Row
Set rng2 = .Range("a1:A" & lastrow2)
End With

irow2 = 1
With ws1
lastrow1 = .Cells(Rows.Count, "A").End(xlUp).Row
For irow1 = 2 To lastrow1
If .Cells(irow1, 10) = "Yes" Then
res = Application.Match(.Cells(irow1, 1), rng2, 0) '<=== matches on
ID in column A
If IsError(res) Then
res = Application.Match(.Cells(irow1, 1), rng2, 1)
If IsError(res) Then
irow2 = irow2 + 1
.Cells(irow1, "A").EntireRow.Copy ws2.Cells(irow2, "A")
Else
res = res + 1
ws2.Cells(res, "A").EntireRow.Insert Shift:=xlDown
.Cells(irow1, "A").EntireRow.Copy ws2.Cells(res, "A")
End If
End If
End If
Next irow1
End With
End Sub





"Jayjay" wrote:

This would be brilliant - all of the Learners already have individual
(unique) 'Learner Numbers'.

Thank you.

Jayjay

"Toppers" wrote:

I have some VBA code which will help BUT it requires a field (numeric ID?) in
Sheet1 which is unique to each person and that the sheet is sorted on this
field.

Let me know is this would be useful.

"Jayjay" wrote:

Hi,

I'm trying to create a formula for the following senario...

I have a table of people (by row) who are progressing through the first part
of some training (worksheet 1) and I have a second table (worksheet 2) with
further training for those people who pass the first part.

I want the details of the people who pass to automatically populate the
second sheet but without blank rows, i.e. if numbers 1, 2, 4 & 8 pass from
sheet one (the column J cells show "Yes") I need them to appear in rows 1, 2,
3 & 4 on sheet 2.

However, there is a further €˜issue...

I have found a formula that moves the names nicely but if, for example,
learner number 5 passes their test, they're details are moved over to the
second sheet and further information is recorded in the columns alongside
them.

However, if learner 4 then passes, their details are 'inserted' into the
second sheet above 5, so 5's 'further details' become 4's...

Any thoughts or ideas?...

Thank you!

Jayjay

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 18
Default Array/Lookups, etc...

Hi Toppers,

Thank you again, this is great.

Unfortunately, I'm obviously doing something wrong as I keep getting a
Syntax Error at the 'ID' line.

I didn't understand where I can post a sample w/book to though - What do I
need to do?

Thank you,

Jayjay

"Toppers" wrote:

Try this:

Match is on an "ID" in column A and MUST be in ascending order.

If there are any problems, post sample w/book to:

toppers at REMOVETHISjohntopley.fsnet.co.uk


Sub Transfer1_2()

Dim ws1 As Worksheet, ws2 As Worksheet
Dim lastrow1 As Long, lastrow2 As Long
Dim inrow2 As Long
Dim rng2 As Range

Set ws1 = Worksheets("Sheet1")
Set ws2 = Worksheets("Sheet2")


With ws2
lastrow2 = .Cells(Rows.Count, "A").End(xlUp).Row
Set rng2 = .Range("a1:A" & lastrow2)
End With

irow2 = 1
With ws1
lastrow1 = .Cells(Rows.Count, "A").End(xlUp).Row
For irow1 = 2 To lastrow1
If .Cells(irow1, 10) = "Yes" Then
res = Application.Match(.Cells(irow1, 1), rng2, 0) '<=== matches on
ID in column A
If IsError(res) Then
res = Application.Match(.Cells(irow1, 1), rng2, 1)
If IsError(res) Then
irow2 = irow2 + 1
.Cells(irow1, "A").EntireRow.Copy ws2.Cells(irow2, "A")
Else
res = res + 1
ws2.Cells(res, "A").EntireRow.Insert Shift:=xlDown
.Cells(irow1, "A").EntireRow.Copy ws2.Cells(res, "A")
End If
End If
End If
Next irow1
End With
End Sub





"Jayjay" wrote:

This would be brilliant - all of the Learners already have individual
(unique) 'Learner Numbers'.

Thank you.

Jayjay

"Toppers" wrote:

I have some VBA code which will help BUT it requires a field (numeric ID?) in
Sheet1 which is unique to each person and that the sheet is sorted on this
field.

Let me know is this would be useful.

"Jayjay" wrote:

Hi,

I'm trying to create a formula for the following senario...

I have a table of people (by row) who are progressing through the first part
of some training (worksheet 1) and I have a second table (worksheet 2) with
further training for those people who pass the first part.

I want the details of the people who pass to automatically populate the
second sheet but without blank rows, i.e. if numbers 1, 2, 4 & 8 pass from
sheet one (the column J cells show "Yes") I need them to appear in rows 1, 2,
3 & 4 on sheet 2.

However, there is a further €˜issue...

I have found a formula that moves the names nicely but if, for example,
learner number 5 passes their test, they're details are moved over to the
second sheet and further information is recorded in the columns alongside
them.

However, if learner 4 then passes, their details are 'inserted' into the
second sheet above 5, so 5's 'further details' become 4's...

Any thoughts or ideas?...

Thank you!

Jayjay

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
two lookups? A.S. Excel Discussion (Misc queries) 4 December 13th 06 03:12 AM
lookups EC Excel Discussion (Misc queries) 5 December 12th 06 08:36 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Max and lookups ajayb Excel Worksheet Functions 2 June 13th 06 12:08 PM
LOOKUPS - Creating LOOKUPs where two different values must BOTH be satisfied. Mr Wiffy Excel Worksheet Functions 2 May 16th 05 04:29 AM


All times are GMT +1. The time now is 12:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"