View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach[_2_] Otto Moehrbach[_2_] is offline
external usenet poster
 
Posts: 1,071
Default Look up cell content by type and copy to different cell

Sam
Something like this macro may work for you. I assumed your original
data is in Column A starting with A2 down, Dates go in Column B, Text in
Column C and Numbers in Column D. HTH Otto
Sub DTS()
Dim rColA As Range
Dim i As Range
Set rColA = Range("A2", Range("A" & Rows.Count).End(xlUp))
Application.ScreenUpdating = False
For Each i In rColA
If IsDate(i.Value) Then
i.Copy Range("B" & Rows.Count).End(xlUp).Offset(1)
GoTo NextCell
End If
If IsNumeric(i.Value) Then
i.Copy Range("D" & Rows.Count).End(xlUp).Offset(1)
GoTo NextCell
End If
i.Copy Range("C" & Rows.Count).End(xlUp).Offset(1)
NextCell:
Next i
Application.ScreenUpdating = True
End Sub
"Sam Huleis" <Sam wrote in message
...
I have a column of cells that contain "date" cells, "text" cells and
"number"
cells. Is there a function that I can use to enable me to copy the
content
of a "date" cell into one column, "text" cell into a second column and
"number" cell into a third column? The version of my product is Excel
2003

Thank you