LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default killing a sub from within an if statement

I am trying to stop a sub from continueing once a set of values i.e. null in
2 cells is attained. Can anyone help me?

Range("A4:w4").Select
Do Until ActiveCell.Value = ""
'Moves #1 PM info down until date matches #4 PM date

If ActiveCell.Value < ActiveCell.Offset(0, 12).Value Then
ActiveCell.Offset(0, 12).Resize(, 11).Insert shift:=xlDown
MsgBox "Loop #1 Column A < Column M"

'If #4Pm's date is greater then #1 PM's date then shift #4 down.
ElseIf ActiveCell.Value ActiveCell.Offset(0, 12).Value Then
ActiveCell.Resize(, 12).Insert shift:=xlDown
MsgBox "Loop #2 Column A Column M
End If

If ActiveCell.Value = ActiveCell.Offset(0, 12).Value And
ActiveCell.Offset(1, 12).Value = "" Then
MsgBox "A = M AND M = Blank"
Kill statement needs to go here
End If

ActiveCell.Offset(1, 0).Select

Loop

End Sub
 
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
Expiring/Killing Macro(s) FARAZ QURESHI Excel Discussion (Misc queries) 5 January 8th 07 08:20 PM
Data collation killing me!! rhani111 Excel Worksheet Functions 19 August 10th 06 02:13 AM
VBA loop is killing me! Dave Bailey Excel Discussion (Misc queries) 1 October 14th 05 07:43 AM
Killing the split window RWN Setting up and Configuration of Excel 2 October 9th 05 06:21 AM
Killing Excel :) Nicolas Mainczyk Excel Programming 1 October 8th 03 03:57 PM


All times are GMT +1. The time now is 11:06 PM.

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"