LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Macro with an IF/OR statement

Hi Kennedy,

I am refering to the first Sirname, Lewis in your example.

Due to the layout changes in this newgroup after copy - past the code
does not look as i made it.
Please try again.

Sub SplitChildern()
Dim intNumberOfKids As Integer
Dim intLoopKids As Integer
Dim intNumberLines As Integer


intNumberLines = Range(ActiveCell,
ActiveCell.End(xlDown)).Rows.Count
ActiveCell.End(xlDown).Offset(1, 0).Select
Do
ActiveCell.Offset(-1, 0).Select
intNumberOfKids = ActiveCell.End(xlToRight).Value
If intNumberOfKids 1 Then
ActiveCell.End(xlToRight).ClearContents
For intLoopKids = 1 To intNumberOfKids - 1
ActiveCell.Offset(intLoopKids, 0).EntireRow.Insert
ActiveCell.Offset(intLoopKids, 4).Value = _
ActiveCell.Offset(0, 4 + intLoopKids * 2).Value
ActiveCell.Offset(intLoopKids, 5).Value = _
ActiveCell.Offset(0, 5 + intLoopKids * 2).Value
ActiveCell.Offset(0, _
4 + intLoopKids * 2).ClearContents
ActiveCell.Offset(0, _
5 + intLoopKids * 2).ClearContents
Next
ActiveCell.End(xlToRight).Offset(0, 1).Value = _
intNumberOfKids
ActiveCell.End(xlToRight).NumberFormat = _
ActiveCell.Offset(0, 6 + intLoopKids * 2).NumberFormat
End If
intNumberLines = intNumberLines - 1
Loop Until intNumberLines = 0
End Sub


HTH,

Wouter
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run a macro from an If statement Steve[_13_] Excel Programming 1 July 30th 07 02:20 AM
Macro statement when opening file, but no macro Robert Smith[_3_] Excel Programming 3 May 20th 07 05:58 PM
Help I need a macro or IF Statement Mascot Excel Programming 6 August 2nd 06 07:42 PM
Macro If Statement Mark64 Excel Programming 2 March 10th 06 11:08 PM
Run Macro From If Statement tkaplan[_2_] Excel Programming 0 June 3rd 05 06:31 PM


All times are GMT +1. The time now is 02:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"