Extract from one sheet to another

B

Bcosta

I have a sheet in a workbook that I want to extract information from based on
Initials in Column G and have the information placed into other sheets in the
workbook based on the initials. I need to have the data in date order (Column
A) and no blank lines. I'm at a complete loss as to how to do this.
 
O

Otto Moehrbach

You will need VBA (programming) for this.
Are the "other sheets" named the initials in column G of that first sheet?
What is the name of the first sheet? What is the layout of your data, i.e.,
how many columns to copy, what columns, starting with what row in that first
sheet, starting with what row in those "other" sheets? HTH Otto
 
B

Bcosta

Columns are:
A B C D E F G H I
J
Date Job# JobName Job$M Job$A PriorC% Mech Appr 3rdMan %Comp

Where Date is entered, Job # is entered
JobName, Job$M, Job$A, PriorC% are brought in from another sheet based on Job#
Mech, Appr, 3rdMan and %Comp are entered

I want the Date, Job#, JobName, %Comp Job$M to copy over to different sheets
based on the initials entered in G

I want the Date, Job#, JobName, %Comp Job$A to copy over to different sheets
based on the initials entered in H

I need to have the data left intact in the original sheets so COPY is a
better word than EXTRACT i suppose.
 
O

Otto Moehrbach

You say "JobName, Job$M, Job$A, PriorC% are brought in from another sheet
based on Job#" Do you need for the code to do this? If so, what is the
name and layout of that other sheet?
You say "I want the Date, Job#, JobName, %Comp Job$M to copy over to
different sheets based on the initials entered in G". Are these "other
sheets" named those initials? In other words, if there is "AB" entered in
Column G, is there a sheet named "AB"? What is the layout of these
"different sheets"? In other words, where in these "different sheets" do
you want the data pasted?
The same questions for copying based on the entries in Column H. Otto
 
B

Bcosta

No I have that info coming in ok.

Yes the sheets are named with the initials.

In "initial" sheet Col A=Date, Col B=Job#, Col C=JobName, Col D=%Comp, Col
E=Job$M
All other columns will be calculations based on the data transfered. Some
of the "initial" sheets will use column G as the selector other
"initial"sheets use column H.
 
O

Otto Moehrbach

This macro should do what you want. I tested it on a file I created. As
written, the sheet from which you want to copy the data must be the active
sheet. This macro loops through all the entries in columns G & H and copies
to the "initial" sheets. If you're not familiar with running macros, send
me an email and I'll send you the file I used. My email is
(e-mail address removed). Remove the "extra" from this address. Otto
Sub Copying()
Dim GH As Variant, i As Range, rCol As Range
Dim Dest As Range, RngABCJ As Range
Dim c As Long
Set RngABCJ = Range("A1:C1,J1")
For Each GH In Array("G", "H")
If GH = "G" Then
Set rCol = Range("G2", Range("G" & Rows.Count).End(xlUp))
c = 4
Else
Set rCol = Range("H2", Range("H" & Rows.Count).End(xlUp))
c = 5
End If
For Each i In rCol
If Not IsEmpty(i.Value) Then
With Sheets(i.Value)
Set Dest = .Range("A" & Rows.Count).End(xlUp).Offset(1)
RngABCJ.Offset(i.Row - 1).Copy
Dest.PasteSpecial xlPasteValues
Cells(i.Row, c).Copy
Dest.Offset(, 4).PasteSpecial xlPasteValues
End With
End If
Next i
Next GH
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top