Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Dave B
 
Posts: n/a
Default evaluating text cell contents

I have a large number of cells with nothing but text in them. I want to
evaluate the first few words in each and then create a macro to move the
contents of that cell to a new column depending on the cell's contents. Any
creative ideas out there? I am using Excel 2000.

  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default evaluating text cell contents

Make a list on a new worksheet of those words/phrases.

Put them in A1:Axx.

Then loop through your cells looking for those words/phrases. If you find
it/them, then move the contents and go to the next cell.

dim ListWks as worksheet
dim wks as worksheet
dim myRng as range
dim myCell as range
dim myListRng as range
dim myListCell as range

set wks = worksheets("sheet1")
set listwks = worksheets("list")

with wks
set myrng = .range("a1",.cells(.rows.count,"A").end(xlup))
end with

with listwks
set mylistrng = .range("a1",.cells(.rows.count,"A").end(xlup))
end with


for each mycell in myrng.cells
for each mylistcell in mylistrng.cells
if application.countif(mycell.value,"*" & mylistcell.value & "*") 0 then
mycell.offset(0,1).value = mycell.value
exit for 'already moved it
end if
next mylistcell
next mycell

=======
Watch out for typos--I didn't test this.


Dave B wrote:

I have a large number of cells with nothing but text in them. I want to
evaluate the first few words in each and then create a macro to move the
contents of that cell to a new column depending on the cell's contents. Any
creative ideas out there? I am using Excel 2000.


--

Dave Peterson
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
How do I set text to top of cell next to wrap text in Excel? Carpenter Gary New Users to Excel 1 October 25th 05 06:26 PM
Text disappears when word wrap is used Mark_GS1CA Excel Discussion (Misc queries) 12 October 17th 05 12:44 PM
Display ALL text contents in cell Flipper1067 Excel Discussion (Misc queries) 10 July 27th 05 02:22 PM
Wrap text ceases to function in Excel if cell exceeds 9 lines nycemail Excel Worksheet Functions 1 July 24th 05 06:09 PM
Using contents of a cell in a formula Mike Excel Discussion (Misc queries) 4 June 9th 05 03:10 AM


All times are GMT +1. The time now is 01:39 PM.

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"