Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default HELP WITH AN EXCEL PROBLEM

I have a data sheet containing 10k rows of survey data. I would like to
know if anyone could help me with a macro that would
1.prompt me for a search term ie. "earthlink"
2.go through all 10000 rows of data in column C and copy the cells that
contain the search term
3.paste the cells in the same row # only in column E.

Is this possible to do? It would save me sooooo much time. I would be
very grateful if anyone would help me with this.
Thanks in advance
Joe

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default HELP WITH AN EXCEL PROBLEM

Sub CopyData()
Dim ans As String, rng1 As Range, rng As Range
Dim sAddr As String
ans = InputBox("Enter Search Term:")
If ans = "" Then Exit Sub
With ActiveSheet
Set rng = .Range(.Range("C2"), .Cells(Rows.Count, "C").End(xlUp))
Set rng1 = rng.Find(What:=ans, _
After:=rng(rng.Count), _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng1 Is Nothing Then
sAddr = rng1.Address
Do
.Cells(rng1.Row, "E").Value = .Cells(rng1.Row, "C").Value
Set rng1 = rng.FindNext(rng1)
Loop While rng1.Address < sAddr
Else
MsgBox ans & " was not found"
End If
End With
End Sub

--
Regards,
Tom Ogilvy

wrote in message
oups.com...
I have a data sheet containing 10k rows of survey data. I would like to
know if anyone could help me with a macro that would
1.prompt me for a search term ie. "earthlink"
2.go through all 10000 rows of data in column C and copy the cells that
contain the search term
3.paste the cells in the same row # only in column E.

Is this possible to do? It would save me sooooo much time. I would be
very grateful if anyone would help me with this.
Thanks in advance
Joe



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
Colon at the end of excel file name(ex: problem.xls:1, problem.xls financeguy New Users to Excel 2 January 15th 10 01:15 AM
Problem viewing Excel 2003 Pivot Chart fields in Excel 2007 ronny B Charts and Charting in Excel 1 October 24th 08 10:08 PM
Weird problem with Excel 2000...Worksheets disappearing in a shared Excel file BrianL_SF Excel Discussion (Misc queries) 2 October 10th 06 08:27 PM
Started out as an Access problem. Now an Excel problem RobertM Excel Discussion (Misc queries) 2 April 26th 06 07:30 PM
EXCEL FORMAT PROBLEM WHEN SENDING EXCEL SHEET AS MESSAGE BODY IN . P.S.Sodha Excel Discussion (Misc queries) 0 April 2nd 05 01:53 PM


All times are GMT +1. The time now is 10:48 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"