El Macro?

MaDHaVoK

Senior member
Mar 7, 2001
601
0
0
Sorry to constatly bother you guys for excel help.... but I can't seem to find any good webistes with good information. I have a 2000 rows and 10 columns of data..... This is what I need....
If A1 doesn't equal A2 then insert 2 rows.
Else
If A2 doesn't equal A3 then insert 2 rows
Else
all the way up to 2000.

Basically column A is all strings, that change ever 4 to 6 rows.... when they change i need to insert 2 rows.....

Also does anyone know a good website to help me LEARN macros?

Thanks
 

NeoV

Diamond Member
Apr 18, 2000
9,504
2
81
the tricky part with VB macro's is the stuff you can't really record, but the macro recorder is a great tool to get you started...just go to tools-macro-record macro, and do some stuff like inserting or deleting rows, updating pivot tables, etc....


Here is a sample of an "if" statement used in a macro, which is what you will need..

Sub two()
Range("a24").Select
If ActiveCell = "" Then
Selection.EntireRow.Delete
Else
End If

This is a macro which deletes rows that contain a blank cell in a certain column....there is much more to the macro than just that, such as moving the cursor down a cell, etc, etc, but this is just to show you how the if part of it looks...pm me if you need any more help!