Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
On Sunday, April 1, 2012 1:13:00 PM UTC-5, gwc wrote:
Col A contains: 1 5 7 10 14 Col B contains: 2 3 6 Col C contains: 4 6 8 11 13 Col D contains: 1 5 8 9 10 12 13 14 15 How do I put, in Col E, each number from the FIRST column it occurred in: 1 (came from Col A) 2 (came from Col B) 3 (came from Col B) 4 (came from Col C) 5 (came from Col A) 6 (came from Col B) 7 (came from Col A) 8 (came from Col C) 9 (came from Col D) 10 (came from Col A) 11 (came from Col C) 12 (came from Col D) 13 (came from Col C) 14 (came from Col A) 15 (came from Col D) try this macro Option Explicit Sub camefromcolSAS() Dim i As Long With ActiveSheet.UsedRange 5 On Error Resume Next For i = 1 To Application.Max(.Value) Cells(i, "e") = i & " found in col " & .Find(What:=i, _ LookIn:=xlFormulas, LookAt:=xlWhole, SearchOrder:=xlByRows, _ SearchDirection:=xlNext).Column Next i End With Columns("e").AutoFit End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing A Column Of Text numbers To True Numbers: How ? | New Users to Excel | |||
Excel, change column of negative numbers to positive numbers? | New Users to Excel | |||
Can I change a column of calculated numbers to absolute numbers? | Excel Discussion (Misc queries) | |||
Changing column of numbers made of formulas to just numbers | Excel Discussion (Misc queries) | |||
Excel Formula - Add column of numbers but ignore negative numbers | Excel Worksheet Functions |