LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,522
Default Numbers from first column

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing A Column Of Text numbers To True Numbers: How ? Robert11[_3_] New Users to Excel 2 March 4th 09 09:08 PM
Excel, change column of negative numbers to positive numbers? Nita New Users to Excel 3 November 27th 07 04:54 AM
Can I change a column of calculated numbers to absolute numbers? Kate Bissell Excel Discussion (Misc queries) 3 October 25th 06 06:10 PM
Changing column of numbers made of formulas to just numbers CJ Excel Discussion (Misc queries) 2 June 14th 06 02:13 PM
Excel Formula - Add column of numbers but ignore negative numbers view for Distribution List members Excel Worksheet Functions 1 April 7th 06 03:13 AM


All times are GMT +1. The time now is 12:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"