VBA - Excel procedure is too Large
<p>From reading the previous answers I understand I need to break up my code. I just need help doing it.</p>

<p>I have a large Select Case Procedure with approx 50 choices. Works Great! Until I programmed half of the "case is =" code for parsing the line if case is true.</p>

<p>It appears that my variable "Dataline" doe not pass to the subroutine. How do I pass the Line variable to my Sub.</p>

<pre><code>Open fName For Input As #FileNum

While Not EOF(FileNum)
    'read in data one line at a time.
    Line Input #FileNum, Dataline

    'Read first three characters of line to determine Line Name
    LineName = Left(Dataline, 3)

    'Find line Name them parse
    Select Case LineName
        Case Is = "EH "     'Envelope Header
            EHsub 'Case sub routine (because I need to breakup code)
    End Select ' End of Select Case
Wend ' end of While Loop

Close #FileNum 'close the file
</code></pre>

<hr>

<pre><code>Sub EHsub()  'if envelope header = "EH " then parse dataline
    Field01 = Mid(Dataline, 1, 3) 'read 2nd data item
    ' I get an error here: "DataLine" is null
    'place date item in data worksheet
    Sheets("FannieData").Cells(Datarow, DataColumn).Value = Field01
End Sub
</code></pre>