Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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
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
add on date specfic Curt Excel Worksheet Functions 1 February 26th 09 10:08 PM
unprotect specfic cells in worksheet ND at sib Excel Worksheet Functions 3 December 30th 08 04:27 PM
specfic number formating bailej03 Excel Programming 3 May 27th 05 03:43 AM
HOW DO I PROGRAM THE TAB KEY TO MOVE IN SPECFIC ORDER? COWBOY Excel Programming 1 November 4th 04 02:10 AM
workbook-specfic Macro Menu in toolbar D Dixon Excel Programming 4 August 2nd 04 08:27 PM


All times are GMT +1. The time now is 06:30 AM.

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

About Us

"It's about Microsoft Excel"