LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default See who's quickest at solving this

Malcolm,

I solved this last week - for somebody else, but do I get a prize for being
fastest <vbg?

Try the code below. Change the xlNo to xlYes (in two places) and the 1 to a
2 in "For row = 1 To...." if you have a header row.

HTH,
Bernie
MS Excel MVP

Sub Macro1()
Dim myCell As Range
Dim row As Long

Range("A:B").Sort key1:=Range("A1"), _
order1:=xlAscending, _
header:=xlNo
Range("C:D").Sort key1:=Range("C1"), _
order1:=xlAscending, _
header:=xlNo

For row = 1 To Application.CountA(Range("A:A"))
If Cells(row, 3).Value < Cells(row, 1).Value Then
Cells(row, 3).Resize(1, 2).Insert Shift:=xlDown
End If
Next row
End Sub



"Malcolm Davidson" wrote in message
...
Hi

An intersting problem and one I get every 2 months, so help here would be

greatly appreciated.

Every 2 months we receive a spreadsheet with new loans that our current

clients are entitled to. The problem is, there always seems to be some
irritating problems that are quite time consuming.

Is it possible to have a spreadsheet with 795 employees with employee ID

as the unique Key in column A, his name in column B and then the new
entitled loan recipients pasted into the sheet with the ID in column C and
the name in Column D. There may only be 500 of the recipients entitled to
the loan so there will be 2 columns (A & B) with 795 rows and 2 columns (C &
D) with 500 rows.

All 500 in column C & D will be in columns A & B but will obviously be out

of line.

I would like to know if there is a macro or function I could run where the

employee ID in column C can line up with it's corresponding Employee ID in
column A, obviously bringing the name in Column D with it. This will mean
inserting blank cells where needed in columns C & D.

I'm baffled just writing this so I hope you can understand what I am

trying to achieve.

Thanks in advance.

M Davidson



 
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
IRR: is there a quickest way? l Excel Worksheet Functions 2 October 15th 06 09:08 PM
Quickest way to input formulas? Aoife101 Excel Discussion (Misc queries) 2 July 20th 06 01:46 PM
What is the quickest and easiest way to learn Excel? InOverMyHead New Users to Excel 2 June 14th 06 01:20 PM
What is the quickest way to hide a lot of rows and colums ? Stephen Tyrrell Excel Discussion (Misc queries) 2 August 19th 05 08:20 AM
Find and Replace - Quickest Option? Lindsey M Excel Worksheet Functions 1 March 8th 05 11:34 AM


All times are GMT +1. The time now is 04:45 PM.

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"