Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting data with a specfic value only
Hello all,
Excel 2007 I obtain a dump of data into an Excel spreadsheet. I cannot change the requested data from the data dump, it simply gives me all the transactions for every client. I wish to extract from this dump of data only the information for one specfic client. I would like to write a macro to do this. The client name appears in the column AG also called sitename. Any ideas, thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting data with a specfic value only
Give this macro a try (change the SearchName constant to the name you want
to keep)... Sub DumpData() Dim X As Long Dim LastRow As Long Const SearchName As String = "Bob" On Error GoTo Whoops Application.ScreenUpdating = False With Worksheets("Sheet1") LastRow = .Cells(.Rows.Count, "AG").End(xlUp).Row For X = LastRow To 1 Step -1 If StrComp(.Cells(X, "AG").Value, SearchName, vbTextCompare) < 0 Then .Rows(X).Delete End If Next End With Whoops: Application.ScreenUpdating = True End Sub -- Rick (MVP - Excel) "ATanker62" wrote in message ... Hello all, Excel 2007 I obtain a dump of data into an Excel spreadsheet. I cannot change the requested data from the data dump, it simply gives me all the transactions for every client. I wish to extract from this dump of data only the information for one specfic client. I would like to write a macro to do this. The client name appears in the column AG also called sitename. Any ideas, thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting data with a specfic value only
Since this code deletes the rows that don't match, I recommend making a copy
of the worksheet before running this. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting data with a specfic value only
Excellent suggestion! Thanks for posting it.
-- Rick (MVP - Excel) "Phillip M. Feldman" wrote in message ... Since this code deletes the rows that don't match, I recommend making a copy of the worksheet before running this. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Selecting data with a specfic value only
Thank you it works great
"Rick Rothstein" wrote: Give this macro a try (change the SearchName constant to the name you want to keep)... Sub DumpData() Dim X As Long Dim LastRow As Long Const SearchName As String = "Bob" On Error GoTo Whoops Application.ScreenUpdating = False With Worksheets("Sheet1") LastRow = .Cells(.Rows.Count, "AG").End(xlUp).Row For X = LastRow To 1 Step -1 If StrComp(.Cells(X, "AG").Value, SearchName, vbTextCompare) < 0 Then .Rows(X).Delete End If Next End With Whoops: Application.ScreenUpdating = True End Sub -- Rick (MVP - Excel) "ATanker62" wrote in message ... Hello all, Excel 2007 I obtain a dump of data into an Excel spreadsheet. I cannot change the requested data from the data dump, it simply gives me all the transactions for every client. I wish to extract from this dump of data only the information for one specfic client. I would like to write a macro to do this. The client name appears in the column AG also called sitename. Any ideas, thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
add on date specfic | Excel Worksheet Functions | |||
unprotect specfic cells in worksheet | Excel Worksheet Functions | |||
specfic number formating | Excel Programming | |||
HOW DO I PROGRAM THE TAB KEY TO MOVE IN SPECFIC ORDER? | Excel Programming | |||
workbook-specfic Macro Menu in toolbar | Excel Programming |