![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 10
|
I have a program that writes to the column A "contact brian" every 10 line.
I need to modify the program to add another line after that every 10th line the would have the words Item# in column A and Category in column B and price in column C Thanks Keyboard Shortcut: Ctrl+i ' Position = 10 Count = 0 RangeString = "A0" Do While Count < 100 RangeString = "A" & Position Range(RangeString).Select Application.CutCopyMode = False Selection.EntireRow.Insert ActiveCell.FormulaR1C1 = "contact Brian" Position = Position + 10 Count = Count + 1 Loop |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Auckland, New Zealand
Posts: 4,209
|
Try this;
Sub test() Position = 10 Count = 0 Application.ScreenUpdating = False Do While Count < 100 Range("A" & Position).EntireRow.Insert With Range("A" & Position) .FormulaR1C1 = "contact Brian" .Offset(1, 0) = "Item#" .Offset(1, 1) = "catogory" .Offset(1, 2) = "price" End With Position = Position + 10 Count = Count + 1 Loop Application.ScreenUpdating = True End Sub Ivan |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|