#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Copy line if

I have a workbook with 4 Sheets(PTR,NMP,Reference data, Work Area). The first
2(PTR and NMP) are used to display the data from Work Area and Reference
Data.

In the Work Area I paste a dataset composed of all projects from the year
for all teams. In reference data I have a list of project numbers relevant
for my team.

For PTR and NMP to have the correct data I first need only the relevant
projects in the Reference tab to be seperated from all other projects in the
workarea sheet. Column A in both Reference Data and WorkArea have the project
numbers.

Then once I only have the projects relevant to my team I need columns C
and S to be searched for 'PTR', if found paste that whole line of data in the
PTR worksheet. Otherwise put it in the NMP worksheet.

What I am specifically looking for is a copy function that will first verify
that it is a project for my team and then that PTR is located in C or S. And
then another that verifies it does not have PTR in column C or S and pastes
those lines.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Copy line if


That sounds a little confusing, is it possible you could upload a sample
workbook?
For further help with it why not join our forums (shown in
the link below) it's completely free, if you do join you will have the
opportunity to add attachmnets to your posts so you can add workbooks to
better illustrate your problems and get help directly with them. Also if
you do join please post in this thread (link found below) so that people
who have been following or helping with this query can continue to do
so. :)
*Why not add a workbook?*
Providing a workbook will not only get you your answer quicker but will
better illustrate your problem, usually when we can see your data (-it
can be dummy data but must be of the same type-) and your structure it
is far easier for us to give you a tailored, workable answer to your
query :)

Kcope8302;416232 Wrote:
I have a workbook with 4 Sheets(PTR,NMP,Reference data, Work Area). The
first
2(PTR and NMP) are used to display the data from Work Area and
Reference
Data.

In the Work Area I paste a dataset composed of all projects from the
year
for all teams. In reference data I have a list of project numbers
relevant
for my team.

For PTR and NMP to have the correct data I first need only the relevant
projects in the Reference tab to be seperated from all other projects
in the
workarea sheet. Column A in both Reference Data and WorkArea have the
project
numbers.

Then once I only have the projects relevant to my team I need columns C
and S to be searched for 'PTR', if found paste that whole line of data
in the
PTR worksheet. Otherwise put it in the NMP worksheet.

What I am specifically looking for is a copy function that will first
verify
that it is a project for my team and then that PTR is located in C or
S. And
then another that verifies it does not have PTR in column C or S and
pastes
those lines.



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=115857

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Copy line if

Here is a better explaination and an example. There was a change in the
requirements that made it a bit easier:

I have a large dataset that I am importing from an outside source. This data
contains all project codes from a specified date. To be able to limit the
data I want to reference I want to compare that data against a list of
project codes specifically for my team and have those transferred to a
seperate worksheet where I will run different analysis on that data.

The raw data would be put in 'Work Area' worksheet. I have a 'Reference
Data' worksheet with the project codes I am working on. I would need column A
in Work Area to be compared to column A in Reference Data. If there is a
match I want that whole line copied to a worksheet call PTR.

Limited Example

Work Area
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
4398348 PA A. Patel 6-08-08
3984845 PA K. Copeland 8-07-08
3039848 DC P. Baker 11-17-08
3043948 FL L. Johnson 3-12-09
3048485 GA T. Raines 5-14-09

Reference Data
Prjt Code
4858589
3984845
3043948

PTR
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
3984845 PA K. Copeland 8-07-08
3043948 FL L. Johnson 3-12-09


"Simon Lloyd" wrote:


That sounds a little confusing, is it possible you could upload a sample
workbook?
For further help with it why not join our forums (shown in
the link below) it's completely free, if you do join you will have the
opportunity to add attachmnets to your posts so you can add workbooks to
better illustrate your problems and get help directly with them. Also if
you do join please post in this thread (link found below) so that people
who have been following or helping with this query can continue to do
so. :)
*Why not add a workbook?*
Providing a workbook will not only get you your answer quicker but will
better illustrate your problem, usually when we can see your data (-it
can be dummy data but must be of the same type-) and your structure it
is far easier for us to give you a tailored, workable answer to your
query :)

Kcope8302;416232 Wrote:
I have a workbook with 4 Sheets(PTR,NMP,Reference data, Work Area). The
first
2(PTR and NMP) are used to display the data from Work Area and
Reference
Data.

In the Work Area I paste a dataset composed of all projects from the
year
for all teams. In reference data I have a list of project numbers
relevant
for my team.

For PTR and NMP to have the correct data I first need only the relevant
projects in the Reference tab to be seperated from all other projects
in the
workarea sheet. Column A in both Reference Data and WorkArea have the
project
numbers.

Then once I only have the projects relevant to my team I need columns C
and S to be searched for 'PTR', if found paste that whole line of data
in the
PTR worksheet. Otherwise put it in the NMP worksheet.

What I am specifically looking for is a copy function that will first
verify
that it is a project for my team and then that PTR is located in C or
S. And
then another that verifies it does not have PTR in column C or S and
pastes
those lines.



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=115857


  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Copy line if

Here is a better explaination of exactly what I am looking to do:

I have a large dataset that I am importing from an outside source. This data
contains all project codes from a specified date. To be able to limit the
data I want to reference I want to compare that data against a list of
project codes specifically for my team and have those transferred to a
seperate worksheet where I will run different analysis on that data.

The raw data would be put in 'Work Area' worksheet. I have a 'Reference
Data' worksheet with the project codes I am working on. I would need column A
in Work Area to be compared to column A in Reference Data. If there is a
match I want that whole line copied to a worksheet call PTR.

Limited Example

Work Area
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
4398348 PA A. Patel 6-08-08
3984845 PA K. Copeland 8-07-08
3039848 DC P. Baker 11-17-08
3043948 FL L. Johnson 3-12-09
3048485 GA T. Raines 5-14-09

Reference Data
Prjt Code
4858589
3984845
3043948

PTR
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
3984845 PA K. Copeland 8-07-08
3043948 FL L. Johnson 3-12-09


"Simon Lloyd" wrote:


That sounds a little confusing, is it possible you could upload a sample
workbook?
For further help with it why not join our forums (shown in
the link below) it's completely free, if you do join you will have the
opportunity to add attachmnets to your posts so you can add workbooks to
better illustrate your problems and get help directly with them. Also if
you do join please post in this thread (link found below) so that people
who have been following or helping with this query can continue to do
so. :)
*Why not add a workbook?*
Providing a workbook will not only get you your answer quicker but will
better illustrate your problem, usually when we can see your data (-it
can be dummy data but must be of the same type-) and your structure it
is far easier for us to give you a tailored, workable answer to your
query :)

Kcope8302;416232 Wrote:
I have a workbook with 4 Sheets(PTR,NMP,Reference data, Work Area). The
first
2(PTR and NMP) are used to display the data from Work Area and
Reference
Data.

In the Work Area I paste a dataset composed of all projects from the
year
for all teams. In reference data I have a list of project numbers
relevant
for my team.

For PTR and NMP to have the correct data I first need only the relevant
projects in the Reference tab to be seperated from all other projects
in the
workarea sheet. Column A in both Reference Data and WorkArea have the
project
numbers.

Then once I only have the projects relevant to my team I need columns C
and S to be searched for 'PTR', if found paste that whole line of data
in the
PTR worksheet. Otherwise put it in the NMP worksheet.

What I am specifically looking for is a copy function that will first
verify
that it is a project for my team and then that PTR is located in C or
S. And
then another that verifies it does not have PTR in column C or S and
pastes
those lines.



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=115857


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Copy line if


This should do what you need:

Code:
--------------------
Sub copy_data()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i As Long
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("Reference Data").Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
MsgBox "There were " & i & " items copied to PTR", vbInformation, "Record Count"
i = ""
End Sub
--------------------



Kcope8302;423370 Wrote:
Here is a better explaination and an example. There was a change in the
requirements that made it a bit easier:

I have a large dataset that I am importing from an outside source. This
data
contains all project codes from a specified date. To be able to limit
the
data I want to reference I want to compare that data against a list of
project codes specifically for my team and have those transferred to a
seperate worksheet where I will run different analysis on that data.

The raw data would be put in 'Work Area' worksheet. I have a 'Reference
Data' worksheet with the project codes I am working on. I would need
column A
in Work Area to be compared to column A in Reference Data. If there is
a
match I want that whole line copied to a worksheet call PTR.

Limited Example

Work Area
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
4398348 PA A. Patel 6-08-08
3984845 PA K. Copeland 8-07-08
3039848 DC P. Baker 11-17-08
3043948 FL L. Johnson 3-12-09
3048485 GA T. Raines 5-14-09

Reference Data
Prjt Code
4858589
3984845
3043948

PTR
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
3984845 PA K. Copeland 8-07-08
3043948 FL L. Johnson 3-12-09


"Simon Lloyd" wrote:


That sounds a little confusing, is it possible you could upload a

sample
workbook?
For further help with it why not join our forums (shown in
the link below) it's completely free, if you do join you will have

the
opportunity to add attachmnets to your posts so you can add workbooks

to
better illustrate your problems and get help directly with them. Also

if
you do join please post in this thread (link found below) so that

people
who have been following or helping with this query can continue to do
so. :)
*Why not add a workbook?*
Providing a workbook will not only get you your answer quicker but

will
better illustrate your problem, usually when we can see your data

(-it
can be dummy data but must be of the same type-) and your structure

it
is far easier for us to give you a tailored, workable answer to your
query :)

Kcope8302;416232 Wrote:
I have a workbook with 4 Sheets(PTR,NMP,Reference data, Work Area).

The
first
2(PTR and NMP) are used to display the data from Work Area and
Reference
Data.

In the Work Area I paste a dataset composed of all projects from

the
year
for all teams. In reference data I have a list of project numbers
relevant
for my team.

For PTR and NMP to have the correct data I first need only the

relevant
projects in the Reference tab to be seperated from all other

projects
in the
workarea sheet. Column A in both Reference Data and WorkArea have

the
project
numbers.

Then once I only have the projects relevant to my team I need

columns C
and S to be searched for 'PTR', if found paste that whole line of

data
in the
PTR worksheet. Otherwise put it in the NMP worksheet.

What I am specifically looking for is a copy function that will

first
verify
that it is a project for my team and then that PTR is located in C

or
S. And
then another that verifies it does not have PTR in column C or S

and
pastes
those lines.



--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage - Microsoft Office Help - Microsoft

Office Discussion' (http://www.thecodecage.com))

------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread: 'Copy line if - The Code Cage Forums'

(http://www.thecodecage.com/forumz/sh...d.php?t=115857)




--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=115857



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Copy line if

When I press CRT+A(shortcut key) and try to run this macro I get the
following error.

I get a Run-Time error '9':
Subscript out of range.

It then highlites the following row.
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)



"Simon Lloyd" wrote:


This should do what you need:

Code:
--------------------
Sub copy_data()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i As Long
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("Reference Data").Range("A1:A" & Range("A" & Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
MsgBox "There were " & i & " items copied to PTR", vbInformation, "Record Count"
i = ""
End Sub
--------------------



Kcope8302;423370 Wrote:
Here is a better explaination and an example. There was a change in the
requirements that made it a bit easier:

I have a large dataset that I am importing from an outside source. This
data
contains all project codes from a specified date. To be able to limit
the
data I want to reference I want to compare that data against a list of
project codes specifically for my team and have those transferred to a
seperate worksheet where I will run different analysis on that data.

The raw data would be put in 'Work Area' worksheet. I have a 'Reference
Data' worksheet with the project codes I am working on. I would need
column A
in Work Area to be compared to column A in Reference Data. If there is
a
match I want that whole line copied to a worksheet call PTR.

Limited Example

Work Area
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
4398348 PA A. Patel 6-08-08
3984845 PA K. Copeland 8-07-08
3039848 DC P. Baker 11-17-08
3043948 FL L. Johnson 3-12-09
3048485 GA T. Raines 5-14-09

Reference Data
Prjt Code
4858589
3984845
3043948

PTR
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
3984845 PA K. Copeland 8-07-08
3043948 FL L. Johnson 3-12-09


"Simon Lloyd" wrote:


That sounds a little confusing, is it possible you could upload a

sample
workbook?
For further help with it why not join our forums (shown in
the link below) it's completely free, if you do join you will have

the
opportunity to add attachmnets to your posts so you can add workbooks

to
better illustrate your problems and get help directly with them. Also

if
you do join please post in this thread (link found below) so that

people
who have been following or helping with this query can continue to do
so. :)
*Why not add a workbook?*
Providing a workbook will not only get you your answer quicker but

will
better illustrate your problem, usually when we can see your data

(-it
can be dummy data but must be of the same type-) and your structure

it
is far easier for us to give you a tailored, workable answer to your
query :)

Kcope8302;416232 Wrote:
I have a workbook with 4 Sheets(PTR,NMP,Reference data, Work Area).

The
first
2(PTR and NMP) are used to display the data from Work Area and
Reference
Data.

In the Work Area I paste a dataset composed of all projects from

the
year
for all teams. In reference data I have a list of project numbers
relevant
for my team.

For PTR and NMP to have the correct data I first need only the

relevant
projects in the Reference tab to be seperated from all other

projects
in the
workarea sheet. Column A in both Reference Data and WorkArea have

the
project
numbers.

Then once I only have the projects relevant to my team I need

columns C
and S to be searched for 'PTR', if found paste that whole line of

data
in the
PTR worksheet. Otherwise put it in the NMP worksheet.

What I am specifically looking for is a copy function that will

first
verify
that it is a project for my team and then that PTR is located in C

or
S. And
then another that verifies it does not have PTR in column C or S

and
pastes
those lines.


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage - Microsoft Office Help - Microsoft

Office Discussion' (http://www.thecodecage.com))

------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread: 'Copy line if - The Code Cage Forums'

(http://www.thecodecage.com/forumz/sh...d.php?t=115857)




--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=115857


  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Copy line if


Thats because Excel thinks the sheet doesn't exist, it may be that there
is an extra space in the name in the code or your worksheet tab or it's
mis spelled.

Kcope8302;423534 Wrote:
When I press CRT+A(shortcut key) and try to run this macro I get the
following error.

I get a Run-Time error '9':
Subscript out of range.

It then highlites the following row.
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)



"Simon Lloyd" wrote:


This should do what you need:

Code:
--------------------
Sub copy_data()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i

As Long
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &

Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("Reference Data").Range("A1:A" & Range("A" &

Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" &

Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
MsgBox "There were " & i & " items copied to PTR", vbInformation,

"Record Count"
i = ""
End Sub
--------------------





--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Copy line if

It is telling me that it finds 0 matches. I made sure to put some in there
that do match the reference data worksheet. After I click the box to verify
there were 0 records found another box informing me of:

Runtime error '13"
Type mismatch

Thanks for your assistance,

"Simon Lloyd" wrote:


Thats because Excel thinks the sheet doesn't exist, it may be that there
is an extra space in the name in the code or your worksheet tab or it's
mis spelled.

Kcope8302;423534 Wrote:
When I press CRT+A(shortcut key) and try to run this macro I get the
following error.

I get a Run-Time error '9':
Subscript out of range.

It then highlites the following row.
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)



"Simon Lloyd" wrote:


This should do what you need:

Code:
--------------------
Sub copy_data()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i

As Long
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &

Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("Reference Data").Range("A1:A" & Range("A" &

Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" &

Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
MsgBox "There were " & i & " items copied to PTR", vbInformation,

"Record Count"
i = ""
End Sub
--------------------





--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763


  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Copy line if

I have got it to where it now will recognize 1 record. Then it goes back to
the error previously stated. When VB is opened it highlites: i = ""

"Kcope8302" wrote:

It is telling me that it finds 0 matches. I made sure to put some in there
that do match the reference data worksheet. After I click the box to verify
there were 0 records found another box informing me of:

Runtime error '13"
Type mismatch

Thanks for your assistance,

"Simon Lloyd" wrote:


Thats because Excel thinks the sheet doesn't exist, it may be that there
is an extra space in the name in the code or your worksheet tab or it's
mis spelled.

Kcope8302;423534 Wrote:
When I press CRT+A(shortcut key) and try to run this macro I get the
following error.

I get a Run-Time error '9':
Subscript out of range.

It then highlites the following row.
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)



"Simon Lloyd" wrote:


This should do what you need:

Code:
--------------------
Sub copy_data()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i
As Long
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("Reference Data").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" &
Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
MsgBox "There were " & i & " items copied to PTR", vbInformation,
"Record Count"
i = ""
End Sub
--------------------





--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763


  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Copy line if

The actual names of the Projects are CRDB#####. Could the fact that these are
not integer values be the reason for the error?

"Kcope8302" wrote:

I have got it to where it now will recognize 1 record. Then it goes back to
the error previously stated. When VB is opened it highlites: i = ""

"Kcope8302" wrote:

It is telling me that it finds 0 matches. I made sure to put some in there
that do match the reference data worksheet. After I click the box to verify
there were 0 records found another box informing me of:

Runtime error '13"
Type mismatch

Thanks for your assistance,

"Simon Lloyd" wrote:


Thats because Excel thinks the sheet doesn't exist, it may be that there
is an extra space in the name in the code or your worksheet tab or it's
mis spelled.

Kcope8302;423534 Wrote:
When I press CRT+A(shortcut key) and try to run this macro I get the
following error.

I get a Run-Time error '9':
Subscript out of range.

It then highlites the following row.
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)



"Simon Lloyd" wrote:


This should do what you need:

Code:
--------------------
Sub copy_data()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i
As Long
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("Reference Data").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" &
Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
MsgBox "There were " & i & " items copied to PTR", vbInformation,
"Record Count"
i = ""
End Sub
--------------------





--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763




  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Copy line if


KCope, can you possibly provide a sample workbook?
*How to get further help with a workbook*
For further help with it why not join our forums (shown in
the link below) it's completely free, if you do join you will have the
opportunity to add attachments to your posts so you can add workbooks to
better illustrate your problems and get help directly with them. Also if
you do join please post in this thread (link found below) so that people
who have been following or helping with this query can continue to do
so. :)

Kcope8302;423821 Wrote:
The actual names of the Projects are CRDB#####. Could the fact that
these are
not integer values be the reason for the error?

"Kcope8302" wrote:

I have got it to where it now will recognize 1 record. Then it goes

back to
the error previously stated. When VB is opened it highlites: i = ""

"Kcope8302" wrote:

It is telling me that it finds 0 matches. I made sure to put some

in there
that do match the reference data worksheet. After I click the box

to verify
there were 0 records found another box informing me of:

Runtime error '13"
Type mismatch

Thanks for your assistance,

"Simon Lloyd" wrote:


Thats because Excel thinks the sheet doesn't exist, it may be

that there
is an extra space in the name in the code or your worksheet tab

or it's
mis spelled.

Kcope8302;423534 Wrote:
When I press CRT+A(shortcut key) and try to run this macro I

get the
following error.

I get a Run-Time error '9':
Subscript out of range.

It then highlites the following row.
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)



"Simon Lloyd" wrote:


This should do what you need:

Code:
--------------------
Sub copy_data()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As

Range, i
As Long
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("Reference Data").Range("A1:A" & Range("A"

&
Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" &
Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
MsgBox "There were " & i & " items copied to PTR",

vbInformation,
"Record Count"
i = ""
End Sub
--------------------





--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('http://www.thecodecage.com'

(http://www.thecodecage.com/))

------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile:

Simon Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread: ' Copy line if - The Code Cage Forums'

(http://www.thecodecage.com/forumz/sh...d.php?t=117763)




--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763

  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Copy line if


Attached is a file with a limited data extract. It should be sufficient
for the purposes of adjusting the macro as needed. The current issues I
am having are that after I click the box to verify there were 0 records
found another box informing me of:

Runtime error '13"
Type mismatch


Again I am looking for:

I have a large dataset that I am importing from an outside source. This
data contains all project codes from a specified date. To be able to
limit the data I want to reference I want to compare that data against a
list of project codes specifically for my team and have those
transferred to a seperate worksheet where I will run different analysis
on that data.

The raw data would be put in 'Work Area' worksheet. I have a 'Reference
Data' worksheet with the project codes I am working on. I would need
column A in Work Area to be compared to column A in Reference Data. If
there is a match I want that whole line copied to a worksheet call PTR.

Limited Example

Work Area
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
4398348 PA A. Patel 6-08-08
3984845 PA K. Copeland 8-07-08
3039848 DC P. Baker 11-17-08
3043948 FL L. Johnson 3-12-09
3048485 GA T. Raines 5-14-09

Reference Data
Prjt Code
4858589
3984845
3043948

PTR
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
3984845 PA K. Copeland 8-07-08
3043948 FL L. Johnson 3-12-09


+-------------------------------------------------------------------+
|Filename: PTR Limited.xlsx |
|Download: http://www.thecodecage.com/forumz/attachment.php?attachmentid=182|
+-------------------------------------------------------------------+

--
kcope8302
------------------------------------------------------------------------
kcope8302's Profile: http://www.thecodecage.com/forumz/member.php?userid=513
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763

  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Copy line if


All sorted, it found and copied 88 matches as you can see in the
attached.

kcope8302;423953 Wrote:
Attached is a file with a limited data extract. It should be sufficient
for the purposes of adjusting the macro as needed. The current issues I
am having are that after I click the box to verify there were 0 records
found another box informing me of:

Runtime error '13"
Type mismatch


Again I am looking for:

I have a large dataset that I am importing from an outside source. This
data contains all project codes from a specified date. To be able to
limit the data I want to reference I want to compare that data against a
list of project codes specifically for my team and have those
transferred to a seperate worksheet where I will run different analysis
on that data.

The raw data would be put in 'Work Area' worksheet. I have a 'Reference
Data' worksheet with the project codes I am working on. I would need
column A in Work Area to be compared to column A in Reference Data. If
there is a match I want that whole line copied to a worksheet call PTR.

Limited Example

Work Area
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
4398348 PA A. Patel 6-08-08
3984845 PA K. Copeland 8-07-08
3039848 DC P. Baker 11-17-08
3043948 FL L. Johnson 3-12-09
3048485 GA T. Raines 5-14-09

Reference Data
Prjt Code
4858589
3984845
3043948

PTR
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
3984845 PA K. Copeland 8-07-08
3043948 FL L. Johnson 3-12-09



+-------------------------------------------------------------------+
|Filename: PTR Limited.xlsm |
|Download: http://www.thecodecage.com/forumz/attachment.php?attachmentid=183|
+-------------------------------------------------------------------+

--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763

  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Copy line if

I believe it is something with the full version that is not allowing it to go
thru. I will forward a full version.

Thanks,

"Simon Lloyd" wrote:


All sorted, it found and copied 88 matches as you can see in the
attached.

kcope8302;423953 Wrote:
Attached is a file with a limited data extract. It should be sufficient
for the purposes of adjusting the macro as needed. The current issues I
am having are that after I click the box to verify there were 0 records
found another box informing me of:

Runtime error '13"
Type mismatch


Again I am looking for:

I have a large dataset that I am importing from an outside source. This
data contains all project codes from a specified date. To be able to
limit the data I want to reference I want to compare that data against a
list of project codes specifically for my team and have those
transferred to a seperate worksheet where I will run different analysis
on that data.

The raw data would be put in 'Work Area' worksheet. I have a 'Reference
Data' worksheet with the project codes I am working on. I would need
column A in Work Area to be compared to column A in Reference Data. If
there is a match I want that whole line copied to a worksheet call PTR.

Limited Example

Work Area
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
4398348 PA A. Patel 6-08-08
3984845 PA K. Copeland 8-07-08
3039848 DC P. Baker 11-17-08
3043948 FL L. Johnson 3-12-09
3048485 GA T. Raines 5-14-09

Reference Data
Prjt Code
4858589
3984845
3043948

PTR
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
3984845 PA K. Copeland 8-07-08
3043948 FL L. Johnson 3-12-09



+-------------------------------------------------------------------+
|Filename: PTR Limited.xlsm |
|Download: http://www.thecodecage.com/forumz/attachment.php?attachmentid=183|
+-------------------------------------------------------------------+

--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763


  #15   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Copy line if


I think it was just the fix that i did in the code, if you want to send
a full version and it has sensitive data you can PM me and i will give
you my email address.

Kcope8302;424025 Wrote:
I believe it is something with the full version that is not allowing it
to go
thru. I will forward a full version.

Thanks,

"Simon Lloyd" wrote:


All sorted, it found and copied 88 matches as you can see in the
attached.

kcope8302;423953 Wrote:
Attached is a file with a limited data extract. It should be

sufficient
for the purposes of adjusting the macro as needed. The current

issues I
am having are that after I click the box to verify there were 0

records
found another box informing me of:

Runtime error '13"
Type mismatch


Again I am looking for:

I have a large dataset that I am importing from an outside source.

This
data contains all project codes from a specified date. To be able

to
limit the data I want to reference I want to compare that data

against a
list of project codes specifically for my team and have those
transferred to a seperate worksheet where I will run different

analysis
on that data.

The raw data would be put in 'Work Area' worksheet. I have a

'Reference
Data' worksheet with the project codes I am working on. I would

need
column A in Work Area to be compared to column A in Reference Data.

If
there is a match I want that whole line copied to a worksheet call

PTR.

Limited Example

Work Area
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
4398348 PA A. Patel 6-08-08
3984845 PA K. Copeland 8-07-08
3039848 DC P. Baker 11-17-08
3043948 FL L. Johnson 3-12-09
3048485 GA T. Raines 5-14-09

Reference Data
Prjt Code
4858589
3984845
3043948

PTR
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
3984845 PA K. Copeland 8-07-08
3043948 FL L. Johnson 3-12-09



+-------------------------------------------------------------------+
|Filename: PTR Limited.xlsm |
|Download:

http://www.thecodecage.com/forumz/attachment.php?attachmentid=183|
+-------------------------------------------------------------------+

--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage - Microsoft Office Help - Microsoft

Office Discussion' (http://www.thecodecage.com))

------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread: ' Copy line if - The Code Cage Forums'

(http://www.thecodecage.com/forumz/sh...d.php?t=117763)




--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763



  #16   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Copy line if


It would be easier to send it thru email. It is not allowing me to
upload.

Thanks


Kcope8302;423534 Wrote:
When I press CRT+A(shortcut key) and try to run this macro I get the
following error.

I get a Run-Time error '9':
Subscript out of range.

It then highlites the following row.
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &
Rows.Count).End(xlUp).Row)



"Simon Lloyd" wrote:


This should do what you need:

Code:
--------------------
Sub copy_data()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i

As Long
Set Rng = Sheets("Work Area").Range("A1:A" & Range("A" &

Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("Reference Data").Range("A1:A" & Range("A" &

Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" &

Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
MsgBox "There were " & i & " items copied to PTR", vbInformation,

"Record Count"
i = ""
End Sub
--------------------



Kcope8302;423370 Wrote:
Here is a better explaination and an example. There was a change in

the
requirements that made it a bit easier:

I have a large dataset that I am importing from an outside source.

This
data
contains all project codes from a specified date. To be able to

limit
the
data I want to reference I want to compare that data against a list

of
project codes specifically for my team and have those transferred

to a
seperate worksheet where I will run different analysis on that

data.

The raw data would be put in 'Work Area' worksheet. I have a

'Reference
Data' worksheet with the project codes I am working on. I would

need
column A
in Work Area to be compared to column A in Reference Data. If there

is
a
match I want that whole line copied to a worksheet call PTR.

Limited Example

Work Area
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
4398348 PA A. Patel 6-08-08
3984845 PA K. Copeland 8-07-08
3039848 DC P. Baker 11-17-08
3043948 FL L. Johnson 3-12-09
3048485 GA T. Raines 5-14-09

Reference Data
Prjt Code
4858589
3984845
3043948

PTR
Prjt Code Site Owner Date
4858589 NY K. Copeland 5-12-08
3984845 PA K. Copeland 8-07-08
3043948 FL L. Johnson 3-12-09


"Simon Lloyd" wrote:


That sounds a little confusing, is it possible you could upload

a
sample
workbook?
For further help with it why not join our forums (shown in
the link below) it's completely free, if you do join you will

have
the
opportunity to add attachmnets to your posts so you can add

workbooks
to
better illustrate your problems and get help directly with them.

Also
if
you do join please post in this thread (link found below) so

that
people
who have been following or helping with this query can continue

to do
so. :)
*Why not add a workbook?*
Providing a workbook will not only get you your answer quicker

but
will
better illustrate your problem, usually when we can see your

data
(-it
can be dummy data but must be of the same type-) and your

structure
it
is far easier for us to give you a tailored, workable answer to

your
query :)

Kcope8302;416232 Wrote:
I have a workbook with 4 Sheets(PTR,NMP,Reference data, Work

Area).
The
first
2(PTR and NMP) are used to display the data from Work Area and
Reference
Data.

In the Work Area I paste a dataset composed of all projects

from
the
year
for all teams. In reference data I have a list of project

numbers
relevant
for my team.

For PTR and NMP to have the correct data I first need only the
relevant
projects in the Reference tab to be seperated from all other
projects
in the
workarea sheet. Column A in both Reference Data and WorkArea

have
the
project
numbers.

Then once I only have the projects relevant to my team I need
columns C
and S to be searched for 'PTR', if found paste that whole line

of
data
in the
PTR worksheet. Otherwise put it in the NMP worksheet.

What I am specifically looking for is a copy function that

will
first
verify
that it is a project for my team and then that PTR is located

in C
or
S. And
then another that verifies it does not have PTR in column C or

S
and
pastes
those lines.


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage - Microsoft Office Help -

Microsoft
Office Discussion' ('The Code Cage - Microsoft Office Help -

Microsoft Office Discussion' (http://www.thecodecage.com)))


------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile:

Simon
Lloyd' ('The Code Cage Forums - View Profile: Simon Lloyd'

(http://www.thecodecage.com/forumz/member.php?userid=1))
View this thread: 'Copy line if - The Code Cage Forums'
(http://www.thecodecage.com/forumz/sh...d.php?t=115857)




--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' ('The Code Cage - Microsoft Office Help - Microsoft

Office Discussion' (http://www.thecodecage.com))

------------------------------------------------------------------------
Simon Lloyd's Profile: 'The Code Cage Forums - View Profile: Simon

Lloyd' (http://www.thecodecage.com/forumz/member.php?userid=1)
View this thread:

http://www.thecodecage.com/forumz/sh...d.php?t=115857




--
kcope8302
------------------------------------------------------------------------
kcope8302's Profile: http://www.thecodecage.com/forumz/member.php?userid=513
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763

  #17   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Copy line if


kcope8302;424035 Wrote:
It would be easier to send it thru email. It is not allowing me to
upload.

ThanksThis code works perfect!


Code:
--------------------
Sub Copy_Data()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i As Long
Set Rng = Sheets("Work Area").Range("A1:A" & Sheets("Work Area").Range("A" & Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("Reference Data").Range("A1:A" & Sheets("Reference Data").Range("A" & Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
Sheets("Reference Data").Range("N1:O" & Sheets("Reference Data").Range("O" & Rows.Count).End(xlUp).Row).Copy Destination:=Sheets("PTR").Range("W2")
MsgBox "There were " & i & " items copied to PTR", vbInformation, "Record Count"
Sheets("PTR").Columns.AutoFit
i = 0
' Copy_Data Macro
'
' Keyboard Shortcut: Ctrl+a
'
End Sub
--------------------


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763

  #18   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Copy line if

Thank you Simon, it worked perfectly!

"Simon Lloyd" wrote:


kcope8302;424035 Wrote:
It would be easier to send it thru email. It is not allowing me to
upload.

ThanksThis code works perfect!


Code:
--------------------
Sub Copy_Data()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i As Long
Set Rng = Sheets("Work Area").Range("A1:A" & Sheets("Work Area").Range("A" & Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("Reference Data").Range("A1:A" & Sheets("Reference Data").Range("A" & Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
Sheets("Reference Data").Range("N1:O" & Sheets("Reference Data").Range("O" & Rows.Count).End(xlUp).Row).Copy Destination:=Sheets("PTR").Range("W2")
MsgBox "There were " & i & " items copied to PTR", vbInformation, "Record Count"
Sheets("PTR").Columns.AutoFit
i = 0
' Copy_Data Macro
'
' Keyboard Shortcut: Ctrl+a
'
End Sub
--------------------


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763


  #19   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Copy line if


Glad we could be of help!


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763

  #20   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Copy line if

One More issues I have run into.

When copying the columns from Reference Data it seems to be directly copying
the columns instead of verifying that lines A match-up between Reference data
and Work Area worksheets.

So at this point it is just copying columns N and O and pasting it into PTR.

Please help me if you can.

Thanks Again!

"Simon Lloyd" wrote:


kcope8302;424035 Wrote:
It would be easier to send it thru email. It is not allowing me to
upload.

ThanksThis code works perfect!


Code:
--------------------
Sub Copy_Data()
Dim Rng As Range, Rng1 As Range, MyCell As Range, oCell As Range, i As Long
Set Rng = Sheets("Work Area").Range("A1:A" & Sheets("Work Area").Range("A" & Rows.Count).End(xlUp).Row)
Set Rng1 = Sheets("Reference Data").Range("A1:A" & Sheets("Reference Data").Range("A" & Rows.Count).End(xlUp).Row)
i = 0
For Each MyCell In Rng1
For Each oCell In Rng
If oCell.Value = MyCell.Value Then
oCell.EntireRow.Copy Destination:=Sheets("PTR").Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
i = i + 1
End If
Next oCell
Next MyCell
Sheets("Reference Data").Range("N1:O" & Sheets("Reference Data").Range("O" & Rows.Count).End(xlUp).Row).Copy Destination:=Sheets("PTR").Range("W2")
MsgBox "There were " & i & " items copied to PTR", vbInformation, "Record Count"
Sheets("PTR").Columns.AutoFit
i = 0
' Copy_Data Macro
'
' Keyboard Shortcut: Ctrl+a
'
End Sub
--------------------


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763




  #21   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Copy line if


Kcope8302;426545 Wrote:
One More issues I have run into.

When copying the columns from Reference Data it seems to be directly
copying
the columns instead of verifying that lines A match-up between
Reference data
and Work Area worksheets.

So at this point it is just copying columns N and O and pasting it into
PTR.

Please help me if you can.

Thanks Again!

"Simon Lloyd" wrote:

That was what you asked for!, you simply said "....haha, another thing i

need....master...critical columns copying doesnt matter if they are at
the end...", i can't take a look now it will be around thie time
tomorrow.


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763

  #22   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 44
Default Copy line if

Sorry for the confusion. I meant to state that the columns coming from
reference data should match the project codes being reference in column A.

Thanks,

"Simon Lloyd" wrote:


Kcope8302;426545 Wrote:
One More issues I have run into.

When copying the columns from Reference Data it seems to be directly
copying
the columns instead of verifying that lines A match-up between
Reference data
and Work Area worksheets.

So at this point it is just copying columns N and O and pasting it into
PTR.

Please help me if you can.

Thanks Again!

"Simon Lloyd" wrote:

That was what you asked for!, you simply said "....haha, another thing i

need....master...critical columns copying doesnt matter if they are at
the end...", i can't take a look now it will be around thie time
tomorrow.


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.thecodecage.com/forumz/member.php?userid=1
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=117763


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
copy first line in a cell Nev Excel Discussion (Misc queries) 6 April 3rd 23 04:39 PM
how to copy a whole line according to one cell in the line to a di kbee Excel Worksheet Functions 2 February 15th 08 08:12 AM
copy to every second line officegirl Excel Discussion (Misc queries) 6 December 6th 07 11:21 PM
Compare a value and if is true copy the line to other worksheet Florian Excel Worksheet Functions 2 July 31st 07 09:36 PM
IN EXCEL...I CANNOT COPY THE TOTAL LINE AND PASTE IT ...I GET REF. wg pollard Excel Worksheet Functions 1 November 8th 04 04:26 PM


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

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

About Us

"It's about Microsoft Excel"