View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Search for text with specific parameter and copy

Text is usually anything that isn't a number or error value. If this isn't
restrictive enough, define what is acceptable.

Sub ABC()
Dim rng as Range, rw as Long
set rng = range(cells(1,"A"),Cells(rows.count,"A").End(xlup) )
for each cell in rng
if ucase(cell.value) = cell.Value then
if len(cell.Value) <= 7 then
Worksheets("Sheet2").Cells(rw,1).Value =
cell.Value
rw = rw + 1
end if
end if
Next
Worksheets("Sheet2").Columns(1).Sort Key1:= _
Worksheets("Sheet2").Range("A1")
End Sub

--
Regards,
Tom Ogilvy

"boronmr" wrote in message
...


"boronmr" wrote:

Hi
I need to search a column full of text, symbols and blanks. I need to
extract only cells which contain text in upper case and has 7 characters
(combination of 6 letters and a digit or just 7 letters). Content of
those
cells need to by copy to another column in alphabetical order.

Thank you for your help


I need to add that needed text may have less characters then 7, however
they
will be still in upper case.