Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Look up cell content by type and copy to different cell
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 |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I copy a row depending on the content of a cell in the row | Excel Worksheet Functions | |||
Copy row based on cell content | New Users to Excel | |||
Copy content of cell to another depending on value of third cell(between worksheets) | Excel Worksheet Functions | |||
Using macro to copy a part of a cell content to next cell | Excel Discussion (Misc queries) | |||
How do I copy the cell-content plus its comment to another cell ? | Excel Worksheet Functions |