Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Conditional Row insertion problem
I'm a newbie to VBA, have been teaching myself the past week, and I'
stuck on the last step of a complex macro I've been writing. What want to do is insert a row (or more than one row in some cases depending on the value returned by one column in the worksheet. Thi function returns either 1, 2, or 3 for each earlier line of data, and want to insert a row after each cell in column D that contains a 2, an insert two rows after each cell in column D that contains a 3. I'm having a tough time figuring out how to go about this. The onl stab I've made at it is the following, which doesn't even do anything range("D:D").Select If Value = 2 Then Selection.EntireRow.Insert (xlShiftDown) ElseIf Value = 3 Then Selection.EntireRow.Insert (xlShiftDown) Selection.EntireRow.Insert (xlShiftDown) End If I would greatly appreciate any assistance with this. thank you -- Message posted from http://www.ExcelForum.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
automatic insertion of row | Excel Worksheet Functions | |||
Row Insertion | Excel Discussion (Misc queries) | |||
Row Insertion Problem | New Users to Excel | |||
Rows Insertion | Excel Worksheet Functions | |||
Row insertion macro | Excel Programming |