ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   I need a macro to grab specific data and transfer it to a now worksheet (https://www.excelbanter.com/excel-programming/328111-i-need-macro-grab-specific-data-transfer-now-worksheet.html)

Jason Ward

I need a macro to grab specific data and transfer it to a now worksheet
 
Hello all,

I have another little macro I need help with, and being new to this I
have been banging my head against my monitor trying to figure it out.
Here is what I am trying to do. I have fields a,b,c,d and I need to
filter data from field b. So I need to get all data the begins with SC
and transfer the entire row to Sheet2, and I need to get all data that
begins with SU and transfer the entire row to sheet3.

Thanks for any help.

Jason


Bob Phillips[_6_]

I need a macro to grab specific data and transfer it to a now worksheet
 
Hi Jason,

Here's some code

Sub FilterData()
Dim iLastRow As Long
iLastRow = Cells(Rows.Count, "B").End(xlUp).Row
With Range("B1:B" & iLastRow)
.AutoFilter Field:=1, Criteria1:="SC"
.SpecialCells(xlCellTypeVisible).EntireRow.Copy _
Destination:=Worksheets("Sheet2").Range("A1")
.AutoFilter
.AutoFilter Field:=1, Criteria1:="SU"
.SpecialCells(xlCellTypeVisible).EntireRow.Copy _
Destination:=Worksheets("Sheet3").Range("A1")
.AutoFilter
End With
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jason Ward" wrote in message
ups.com...
Hello all,

I have another little macro I need help with, and being new to this I
have been banging my head against my monitor trying to figure it out.
Here is what I am trying to do. I have fields a,b,c,d and I need to
filter data from field b. So I need to get all data the begins with SC
and transfer the entire row to Sheet2, and I need to get all data that
begins with SU and transfer the entire row to sheet3.

Thanks for any help.

Jason




Jason Ward

I need a macro to grab specific data and transfer it to a now worksheet
 

Hi Bob, Thanks for all your help. I have a quick question for you.
Criteria1:="SC" Filter all data that begins with "SC" for example some
maybe SC-11304 and others maybe SCC-39488 etc... and the same with "SU"

Thanks again,

Jason



*** Sent via Developersdex http://www.developersdex.com ***

Tom Ogilvy

I need a macro to grab specific data and transfer it to a now worksheet
 
Criteria1:="SC*"

Same for SU
--
Regards,
Tom Ogilvy

"Jason Ward" wrote in message
...

Hi Bob, Thanks for all your help. I have a quick question for you.
Criteria1:="SC" Filter all data that begins with "SC" for example some
maybe SC-11304 and others maybe SCC-39488 etc... and the same with "SU"

Thanks again,

Jason



*** Sent via Developersdex http://www.developersdex.com ***




Jason Ward

I need a macro to grab specific data and transfer it to a now worksheet
 


I know that this is a bit of topic, but is there a way that I could code
a button to import data from a DBF 4 file into a worksheet in stead of
having that dbf 4 file open in it own window? Thanks again for all of
the help. It is really appreciated.

Jason

*** Sent via Developersdex http://www.developersdex.com ***


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com