Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Urgent-formating of columns

Dear all
I am a newbie,and looking urgently for help.Any comments will be appreciate
I have two columns in a spreadsheets as below.I want to match these two columns and insert a blank cell in column No2 where the two values in the cells dont match.For example I want to insert a blank cell in column before A2 in No2 and one blank cell after A2 to match A3 etc .How do I go about this?
No1 No
A1 A
A2 A
A3 A
A4
A5
A6

After formatin
No1 No
A
A2 A
A
A4 A
A
A6 A

Thank
Poga

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Urgent-formating of columns

Pogas,

You might be better off using a VLOOKUP function to lookup your values.

If not, then this procedure should work.

Sub test()
Dim i As Long, lngLastRow As Long

With Sheet1
lngLastRow = .Cells(Rows.Count, 1).End(xlUp).Row
For i = 1 To lngLastRow
If .Cells(i, 1).Value < .Cells(i, 2).Value Then .Cells(i,
2).Insert xlShiftDown
Next
End With
End Sub


Rob


"Pogas" wrote in message
...
Dear all,
I am a newbie,and looking urgently for help.Any comments will be

appreciated
I have two columns in a spreadsheets as below.I want to match these two

columns and insert a blank cell in column No2 where the two values in the
cells dont match.For example I want to insert a blank cell in column before
A2 in No2 and one blank cell after A2 to match A3 etc .How do I go about
this??
No1 No2
A1 A2
A2 A4
A3 A6
A4
A5
A6


After formating
No1 No2
A1
A2 A2
A3
A4 A4
A5
A6 A6

Thanks
Pogas



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
Urgent!! compare 2 columns of numbers for duplicates SBecker Excel Discussion (Misc queries) 2 April 20th 10 09:23 PM
Matching data from three columns (VLOOKUP, HLOOKUP, etc...)-URGENT shulmany Excel Worksheet Functions 5 January 15th 09 09:04 AM
HELP FORMATING COLUMNS Ron Coderre Excel Discussion (Misc queries) 0 July 4th 07 12:10 AM
FORMATING COLUMNS..... HELP JTEFUN New Users to Excel 4 July 3rd 07 07:31 PM
Formating columns dbrumit Excel Discussion (Misc queries) 4 January 11th 05 01:21 PM


All times are GMT +1. The time now is 02:34 PM.

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"