Copy and Past to Differerent Work Sheet
Thanks sebastienm. It works perfect.
You folks are great, my hats off to you.
--
Terry
"sebastienm" wrote:
Hi Terry,
The sub CopyDataColumn:
-Searches for a string (SearchedTerm) within a worksheet (SearchedSheet).
The whole cell must contain the searched string, say "BVDSX". If you are
looking for partial match, search for "BVDSX*" instead (with the wildcard
character * )
-If not found, the sub just exits.
-If found, the sub determines the end of the data in that column.
-finally it copies the searched string + the its data column in the
destination range (Destination).
Sub test()
'Search for BVDSX in the active sheet and copy data to sheet2 range b1
of the
' active workbook
CopyDataColumn _
"BVDSX", ActiveSheet, ActiveWorkbook.Sheets("sheet2").Range("b1")
End Sub
'------------------------------------
Sub CopyDataColumn( _
SearchedTerm As String, SearchedSheet As Worksheet, Destination As Range)
Dim rgOrigin As Range, rg As Range
'Find SearchedTerm
Set rgOrigin = SearchedSheet.Cells.Find(what:=SearchedTerm,
LookIn:=xlValues, lookat:=xlWhole)
If rgOrigin Is Nothing Then Exit Sub
'Set origin
Set rgOrigin = Application.Range(rgOrigin,
rgOrigin.EntireColumn.Cells(65536).End(xlUp))
'Copy Origin to Destination
Application.CutCopyMode = False
rgOrigin.Copy Destination.Cells(1)
End Sub
'-------------------------------------------
--
Regards,
Sébastien
<http://www.ondemandanalysis.com
"Terry" wrote:
BVDSX could be found anywhere unfortunately the data comes from diff
locations all have different formatting preferences, when wafers are built
they go to Probing where data is extracted and then diff location where dies
are packaged then they go through final testing, then go to my place where a
diff set of hands touch, Im trying to get data in one format where everyone
can understand and parameters easy to locate at a glance, the data has spaces
and << signs which makes things really complicated - I have that formatting
under control I think : )
I would like all data under BVDSX copied.
Thanks for taking the time; this will save me a lot of time, hours or days
of formatting and summing data
Thanks again
Terry
|