PC Review


Reply
Thread Tools Rate Thread

Developing Macros

 
 
Tim Ashcom
Guest
Posts: n/a
 
      1st Aug 2008
Creating a Macro; Simply inserting 4 blank rows between two populated rows.
Here is what I did and it works.

Sub Add4Lines()
Application.ScreenUpdating = False
Do Until ActiveCell.Text = ""
ActiveCell.EntireRow.Insert
ActiveCell.EntireRow.Insert
ActiveCell.EntireRow.Insert
ActiveCell.EntireRow.Insert
ActiveCell.Offset(5, 0).Select
Loop
End Sub


Now I need to figure out how to insert blank rows to show in this format
(Column A & B are formated according to above macro. Column C & D is what I
need the new macro for). On Column C, starting at R1 (Row 1), there are two
blank rows before the next populated row at R3. Then two more blank rows and
then R6 is populated with data. Here is where it gets tricky. Between
populated rows R6 & R8, there is a blank row. The format is basically every
2-1/2 rows, there is a populated row. Just scroll down and you will see the
pattern.

Column A Column B Column C
Column D
R1 0.900000036 -4.394664288
R2
R3 1.400000095 25.50197601
R4
R5
R6 1.900000095 -2.563554049 1.900000095 25.50197601
R7
R8 2.400000095 25.52112961
R9
R10
R11 2.900000095 -32.22753525 2.900000095 25.54034042
R12
R13 3.400000095 25.55951309
R14
R15
R16 3.900000095 0.732443988 3.900000095 25.55951309
R17
R18 4.400000095 25.57868385
R18
R20
R21 4.900000095 -2.929775953 4.900000095 25.59783554


If anyone can help me out on this on, it would be greatly appreciated.

Thanks,

Tim Ashcom


 
Reply With Quote
 
 
 
 
Joel
Guest
Posts: n/a
 
      1st Aug 2008
ry this

Sub Add4Lines()
Application.ScreenUpdating = False
RowCount = 1
Do While Range("A" & RowCount) <> ""
Rows(RowCount + 1).Insert
Rows(RowCount + 1).Insert
Rows(RowCount + 4).Insert
RowCount = RowCount + 5
Loop
End Sub

"Tim Ashcom" wrote:

> Creating a Macro; Simply inserting 4 blank rows between two populated rows.
> Here is what I did and it works.
>
> Sub Add4Lines()
> Application.ScreenUpdating = False
> Do Until ActiveCell.Text = ""
> ActiveCell.EntireRow.Insert
> ActiveCell.EntireRow.Insert
> ActiveCell.EntireRow.Insert
> ActiveCell.EntireRow.Insert
> ActiveCell.Offset(5, 0).Select
> Loop
> End Sub
>
>
> Now I need to figure out how to insert blank rows to show in this format
> (Column A & B are formated according to above macro. Column C & D is what I
> need the new macro for). On Column C, starting at R1 (Row 1), there are two
> blank rows before the next populated row at R3. Then two more blank rows and
> then R6 is populated with data. Here is where it gets tricky. Between
> populated rows R6 & R8, there is a blank row. The format is basically every
> 2-1/2 rows, there is a populated row. Just scroll down and you will see the
> pattern.
>
> Column A Column B Column C
> Column D
> R1 0.900000036 -4.394664288
> R2
> R3 1.400000095 25.50197601
> R4
> R5
> R6 1.900000095 -2.563554049 1.900000095 25.50197601
> R7
> R8 2.400000095 25.52112961
> R9
> R10
> R11 2.900000095 -32.22753525 2.900000095 25.54034042
> R12
> R13 3.400000095 25.55951309
> R14
> R15
> R16 3.900000095 0.732443988 3.900000095 25.55951309
> R17
> R18 4.400000095 25.57868385
> R18
> R20
> R21 4.900000095 -2.929775953 4.900000095 25.59783554
>
>
> If anyone can help me out on this on, it would be greatly appreciated.
>
> Thanks,
>
> Tim Ashcom
>
>

 
Reply With Quote
 
Tim Ashcom
Guest
Posts: n/a
 
      1st Aug 2008
Joel,

It worked! Appreciate your help very much since I am a novice when it comes
to developing marcro's.

Thanks again, Tim

"Joel" wrote:

> ry this
>
> Sub Add4Lines()
> Application.ScreenUpdating = False
> RowCount = 1
> Do While Range("A" & RowCount) <> ""
> Rows(RowCount + 1).Insert
> Rows(RowCount + 1).Insert
> Rows(RowCount + 4).Insert
> RowCount = RowCount + 5
> Loop
> End Sub
>
> "Tim Ashcom" wrote:
>
> > Creating a Macro; Simply inserting 4 blank rows between two populated rows.
> > Here is what I did and it works.
> >
> > Sub Add4Lines()
> > Application.ScreenUpdating = False
> > Do Until ActiveCell.Text = ""
> > ActiveCell.EntireRow.Insert
> > ActiveCell.EntireRow.Insert
> > ActiveCell.EntireRow.Insert
> > ActiveCell.EntireRow.Insert
> > ActiveCell.Offset(5, 0).Select
> > Loop
> > End Sub
> >
> >
> > Now I need to figure out how to insert blank rows to show in this format
> > (Column A & B are formated according to above macro. Column C & D is what I
> > need the new macro for). On Column C, starting at R1 (Row 1), there are two
> > blank rows before the next populated row at R3. Then two more blank rows and
> > then R6 is populated with data. Here is where it gets tricky. Between
> > populated rows R6 & R8, there is a blank row. The format is basically every
> > 2-1/2 rows, there is a populated row. Just scroll down and you will see the
> > pattern.
> >
> > Column A Column B Column C
> > Column D
> > R1 0.900000036 -4.394664288
> > R2
> > R3 1.400000095 25.50197601
> > R4
> > R5
> > R6 1.900000095 -2.563554049 1.900000095 25.50197601
> > R7
> > R8 2.400000095 25.52112961
> > R9
> > R10
> > R11 2.900000095 -32.22753525 2.900000095 25.54034042
> > R12
> > R13 3.400000095 25.55951309
> > R14
> > R15
> > R16 3.900000095 0.732443988 3.900000095 25.55951309
> > R17
> > R18 4.400000095 25.57868385
> > R18
> > R20
> > R21 4.900000095 -2.929775953 4.900000095 25.59783554
> >
> >
> > If anyone can help me out on this on, it would be greatly appreciated.
> >
> > Thanks,
> >
> > Tim Ashcom
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macros in Personal.xls that would create two toolbars and buttonswith assigned macros =?Utf-8?B?SmF5?= Microsoft Excel Programming 1 30th Mar 2007 12:02 AM
Developing Macros =?Utf-8?B?RWQuUm9i?= Microsoft Excel Misc 1 22nd Jun 2006 06:51 AM
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Microsoft Excel Programming 0 12th Dec 2004 09:19 PM
Removing Excel message to enable macros or disable macros =?Utf-8?B?Ym1pbGxlcjI2Mw==?= Microsoft Excel Misc 2 13th Oct 2004 02:39 PM
Re: The macros in this project are disabled. Please refer to the online help or documentation of the host application to determine how to enable macros. Sue Mosher [MVP-Outlook] Microsoft Outlook Installation 0 17th Feb 2004 05:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:06 AM.