Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a Sub that dumps information into a worksheet. When a certain amount a
data is dumped, the routine makes a call to another sub to find a clear cell and then it continues. My range is only from $L$19 to $L$45 and I would like it if I could use the "new cell" routine to force the termination of the data dump routine when the range has been exceeded. Possible? Here's the "new cell" code: Sub newCell() Dim whiteSpace As Object Dim curCell As Integer Set whiteSpace = CreateObject("VBScript.RegExp") whiteSpace.IgnoreCase = True whiteSpace.Pattern = "^\s*$" If ActiveSheet.name < "myForm" Then Sheet2.Activate If Not ActiveCell.Address = "$L$19" Then Range("L19").Select For curCell = 19 To 45 If (whiteSpace.test(ActiveCell.value)) Then Exit For ElseIf curCell 45 Then MsgBox "No more line entries available." & _ Chr(13) & "Please combine your entries and resubmit." Exit For Else ActiveCell.Offset(1, 0).Select End If Next End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Data Validation/Lookup function does function correcty | Excel Worksheet Functions | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Excel - User Defined Function Error: This function takes no argume | Excel Programming | |||
Need to open the Function Arguments window from VBA for a user defined function. | Excel Programming | |||
User-Defined Function pre-empting Built-in Function? How to undo???? | Excel Programming |