Thread: sorting data
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Otto Moehrbach[_2_] Otto Moehrbach[_2_] is offline
external usenet poster
 
Posts: 1,071
Default sorting data

Michele
If you wish, send me an email and I'll send you the small file that has
this macro in it and properly placed. Looking at my file and reading my
"How To" below, you may be able to get the macro into your file and running.
My email address is . Remove the "extra" from
this address.
Here is my "How To".
Open your file.
Do Alt - F11.
That takes you to the VBE (Visual Basic Editor).
You should see a window on the left side of screen that has a title of
"Project". If you don't see this window, click on View - Project Explorer.
Now you see it.
In this window, find your file name.
Click on your file name.
Be sure that your file name appears at the top of the screen.
Click Insert - Module.
A blank white large window will appear to the right of the "Project
Explorer" window. That is a module.
Copy my macro and paste it in that module.
"X" out of the module to return to your sheet.
You must have the sheet that has the 2 columns of data on the screen.
How do you run the macro? Here's how.
Click on Tools - Macro - Macros. This brings up a dialog box.
Within that box is a space labeled "Macros in:" Click on the down-arrow
and select "ThisWorkbook".
You should see the name of the macro I wrote for you. Click on it and click
on "Run".
That's it.
Tell me what happens. By the way, what version of Excel are you using? HTH
Otto
"Michele" wrote in message
...
Your assumptions are correct, however I know nothing about "macro". How
do I
run this??
--
Michele


"Otto Moehrbach" wrote:

Michele
This little macro will do what you want. I assumed that your 2
columns
are Columns A & B. I assumed that your data has headers in row 1 and the
data starts in row 2. HTH Otto
Sub FilterAB()
Dim rColA As Range
Dim rColC As Range
Dim i As Range
Application.ScreenUpdating = False
Range("B1").EntireColumn.Insert
Set rColA = Range("A2", Range("A" & Rows.Count).End(xlUp))
Set rColC = Range("C2", Range("C" & Rows.Count).End(xlUp))
For Each i In rColA
If Not rColC.Find(What:=i.Value, LookAt:=xlWhole) Is Nothing
Then
i.Offset(, 1).Value = i.Value
End If
Next i
Range("C1").EntireColumn.Delete
Application.ScreenUpdating = True
End Sub
"Michele" wrote in message
...
see below.
I have this: 2 columns
123456 123455
123457 123456
123458 123459
123459 123467
I want it like this:
123455
123456 123456
123457
123458
123459 123459
123467
If there is a match- i want it to be side by side, if no match - leave
a
blank.
Thanks for you help.

--
Michele


"Otto Moehrbach" wrote:

It creates a blank where? Do you want cells moved to create this
blank?
Or
do you want some cell cleared to create this blank? HTH Otto
"Michele" wrote in message
...
I have a spread sheet that I am trying to compare item descriptions.
My
column headers are DESC 400 - CDM 400- CDM HSM - DESC HSM. What i
have
is
CDM 400 numbers that may or may not be in the CDM HSM numbers - I
want
to
sort or filter them so it the number is not in HSM but in 400, it
creates
a
blank. Any input will be great.
--
Michele