Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Urgent!! compare 2 columns of numbers for duplicates | Excel Discussion (Misc queries) | |||
Matching data from three columns (VLOOKUP, HLOOKUP, etc...)-URGENT | Excel Worksheet Functions | |||
HELP FORMATING COLUMNS | Excel Discussion (Misc queries) | |||
FORMATING COLUMNS..... HELP | New Users to Excel | |||
Formating columns | Excel Discussion (Misc queries) |