Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I set text to top of cell next to wrap text in Excel? | New Users to Excel | |||
Text disappears when word wrap is used | Excel Discussion (Misc queries) | |||
Display ALL text contents in cell | Excel Discussion (Misc queries) | |||
Wrap text ceases to function in Excel if cell exceeds 9 lines | Excel Worksheet Functions | |||
Using contents of a cell in a formula | Excel Discussion (Misc queries) |