Help with Opening with deleing end of File

G

Guest

Have 2 files:
Picklist.xls
Tapecompare.xlt
I have information coming from the mainframe into PickList.xls.
Picklist.xls now has a end of file character. I need to delete the charcter
before opening the template...TapeCompare.xlt. All data will reside in Column
A. The data is a list of tapes numbers. The rows will vary,but the lastrow
after the list will contain the end of file character. I have tried running a
macro ,but no good results from that. here is the code I have .

Private Sub CommandButton1_Click()
Dim LastRow As Long
If Not IsNumeric(LastRow) Then
Range("A65536").End(xlUp).EntireRow.Delete
End If
Workbooks.Open Filename:= _
"C:\Documents and Settings\Owner\My Documents\TapeCompare4.XLT",
UpdateLinks _
:=3, Editable:=True

End Sub
 
B

Bob Phillips

The order of the code looks suspect

Private Sub CommandButton1_Click()
Dim LastRow As Long
LastRow = Range("A65536").End(xlUp).Row
If Not IsNumeric(LastRow) Then
Rows(LastRow).Delete
End If
Workbooks.Open Filename:= _
"C:\Documents and Settings\Owner\My Documents\TapeCompare4.XLT", _
UpdateLinks:=3, Editable:=True

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top