Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 505
Default Excel 2002 : Formula to pick up codes

Dear Sir,

May I know is there any formula that can be input at cell A1 to pick up the
code in column B without repeating its self when it is copied downwards ?

Worksheet Illustration
A B
1 AXP22 AXP22
2 BJT48 AXP22
3 GFR96 AXP22
4 LPC14 BJT48
5 MAP36 BJT48
6 NBB21 NBB21
7 ZAT11 NBB21
8 LPC14
9 LPC14
10 LPC14
11 MAP36
12 MAP36
13 MAP36
14 ZAT11
15 ZAT11
16 GFR96
17 GFR96


If column B is not sorted, can I use back the same formula ?


Thanks

Low


A36B58K641
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Excel 2002 : Formula to pick up codes

Enter and run this macro:

Sub MrLow()
Range("B:B").Copy Range("A1")
lastcell = Range("A65536").End(xlUp).Row
For i = lastcell To 2 Step -1
If Cells(i, 1).Value = Cells(i - 1, 1).Value Then
Cells(i, 1).Delete
End If
Next
End Sub
--
Gary's Student


"Mr. Low" wrote:

Dear Sir,

May I know is there any formula that can be input at cell A1 to pick up the
code in column B without repeating its self when it is copied downwards ?

Worksheet Illustration
A B
1 AXP22 AXP22
2 BJT48 AXP22
3 GFR96 AXP22
4 LPC14 BJT48
5 MAP36 BJT48
6 NBB21 NBB21
7 ZAT11 NBB21
8 LPC14
9 LPC14
10 LPC14
11 MAP36
12 MAP36
13 MAP36
14 ZAT11
15 ZAT11
16 GFR96
17 GFR96


If column B is not sorted, can I use back the same formula ?


Thanks

Low


A36B58K641

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 505
Default Excel 2002 : Formula to pick up codes

Hello Gary's Student,

The steps looks a bit complicated.

Is there any other simpler way of doing this ?

Any suggestion from anyone ?

Thanks

Low

--
A36B58K641


"Gary''s Student" wrote:

Enter and run this macro:

Sub MrLow()
Range("B:B").Copy Range("A1")
lastcell = Range("A65536").End(xlUp).Row
For i = lastcell To 2 Step -1
If Cells(i, 1).Value = Cells(i - 1, 1).Value Then
Cells(i, 1).Delete
End If
Next
End Sub
--
Gary's Student


"Mr. Low" wrote:

Dear Sir,

May I know is there any formula that can be input at cell A1 to pick up the
code in column B without repeating its self when it is copied downwards ?

Worksheet Illustration
A B
1 AXP22 AXP22
2 BJT48 AXP22
3 GFR96 AXP22
4 LPC14 BJT48
5 MAP36 BJT48
6 NBB21 NBB21
7 ZAT11 NBB21
8 LPC14
9 LPC14
10 LPC14
11 MAP36
12 MAP36
13 MAP36
14 ZAT11
15 ZAT11
16 GFR96
17 GFR96


If column B is not sorted, can I use back the same formula ?


Thanks

Low


A36B58K641

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 26
Default Excel 2002 : Formula to pick up codes

Hi

Enter this in A1 and drag down

=IF(COUNTIF($B$1:B1,B1)=1,B1,"")

This will return the unique items form Col B.

then enter this array (ctrl + shift + enter) in C1 and drag down

=IF(ROW()-ROW($B$1:$B$17)+1ROWS($A$1:$A$17)-COUNTBLANK($A$1:$A$17),"",INDIRECT(ADDRESS(SMALL(( IF($A$1:$A$17<"",ROW($A$1:$A$17),ROW()+ROWS($A$1: $A$17))),ROW()-ROW($B$1:$B$17)+1),COLUMN($A$1:$A$17),4)))

or

You can avoid the 2nd formula by entering he below in A1 and dragging
down

=IF(COUNTIF($B$1:B1,B1)=1,B1,"")

Then Select col A and Paste special values. Then Filter on Col A
selecting non blanks. Select range press Ctrl + g special and select
visible then copy range to say C1.

or

Just goto Data Filter Advance Filter Unique range and then select
range press Ctrl + g special and select visible then copy range to
say C1.

VBA Noob


Mr. Low wrote:
Hello Gary's Student,

The steps looks a bit complicated.

Is there any other simpler way of doing this ?

Any suggestion from anyone ?

Thanks

Low

--
A36B58K641


"Gary''s Student" wrote:

Enter and run this macro:

Sub MrLow()
Range("B:B").Copy Range("A1")
lastcell = Range("A65536").End(xlUp).Row
For i = lastcell To 2 Step -1
If Cells(i, 1).Value = Cells(i - 1, 1).Value Then
Cells(i, 1).Delete
End If
Next
End Sub
--
Gary's Student


"Mr. Low" wrote:

Dear Sir,

May I know is there any formula that can be input at cell A1 to pick up the
code in column B without repeating its self when it is copied downwards ?

Worksheet Illustration
A B
1 AXP22 AXP22
2 BJT48 AXP22
3 GFR96 AXP22
4 LPC14 BJT48
5 MAP36 BJT48
6 NBB21 NBB21
7 ZAT11 NBB21
8 LPC14
9 LPC14
10 LPC14
11 MAP36
12 MAP36
13 MAP36
14 ZAT11
15 ZAT11
16 GFR96
17 GFR96


If column B is not sorted, can I use back the same formula ?


Thanks

Low


A36B58K641


Reply
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
I was looking to get assistance with a formula in Excel 2002 cashman Excel Worksheet Functions 7 July 21st 06 02:15 PM
Excel 2002 Lookup formula returning wrong results? Val Excel Worksheet Functions 1 November 18th 05 09:07 PM
Vlookup formula Excel version 2002 biz Excel Discussion (Misc queries) 0 September 7th 05 01:07 AM
VLookup Formula Excel Version 2002 biz Excel Worksheet Functions 0 September 1st 05 06:00 PM
Excel 2000 to Excel 2002 problem Dave the slaphead Excel Discussion (Misc queries) 3 February 17th 05 06:17 PM


All times are GMT +1. The time now is 11:43 AM.

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

About Us

"It's about Microsoft Excel"