Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an excel spreadsheet with 20k rows of data. Want to add a row
in between each one and in column A of each newly created row put in "=========" without the quotes. Can someone suggest a macro to do this? Thanks. JR |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Have the below which basically works, just not sure how to add the
quoted text I listed in my original post into each line: Sub test() InsertSpaceRow ActiveSheet, 3, 10 End Sub 'takes a sheet , a start row number and an end row number Sub InsertSpaceRow(Wsh As Worksheet, rowStart As Long, rowEnd As Long) Dim i As Long Application.ScreenUpdating = False For i = rowEnd To rowStart Step -1 Wsh.Range(i & ":" & i).EntireRow.Insert Next End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this a try...
Sub InsertLines() Dim wks As Worksheet Dim rng As Range Set wks = ActiveSheet With wks Set rng = .Cells(Rows.Count, "A").End(xlUp) Do While rng.Row 1 rng.EntireRow.Insert rng.Offset(-1, 0).Value = "'=========" Set rng = rng.Offset(-2, 0) Loop End With End Sub -- HTH... Jim Thomlinson "JR" wrote: I have an excel spreadsheet with 20k rows of data. Want to add a row in between each one and in column A of each newly created row put in "=========" without the quotes. Can someone suggest a macro to do this? Thanks. JR |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Sub test() Dim i As Integer i = 2 Do Until Cells(i, 1).Value = "" If Cells(i, 1).Value = "" Then Exit Do Else: Cells(i, 1).Select Rows(i).Insert Shift:=xlDown Cells(i, 1).Value = "'=========" i = i + 2 End If Loop End Su -- dok11 ----------------------------------------------------------------------- dok112's Profile: http://www.excelforum.com/member.php...fo&userid=1058 View this thread: http://www.excelforum.com/showthread.php?threadid=53279 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Using TEXT and &TEXT - display numbers with commas, underline text | Excel Discussion (Misc queries) | |||
Sumif text is contained winthin a longer text string in a cell | Excel Worksheet Functions | |||
Text does not display in "Text boxs" and when wrapping text in a c | Excel Discussion (Misc queries) | |||
Excel VBA: Worksheet cell .Text property: 1024 bytes text len limit | Excel Programming | |||
extracting text from within a cell - 'text to rows@ equivalent of 'text to columns' | Excel Programming |