View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Run-time error: '9'

This is to do with the workbook name only..Please check for spaces...OR in
immediate window type ?Activeworkbook.name and copy paste..

If it is the activeworkbook you can try the below



Dim CDLastRow As Long 'Catalyst Dump
Dim EDLastRow As Long 'Exported Data

CDLastRow = Activeworkbook.Sheets("Catalyst Dump").Cells(Rows.Count,
"A").End(xlUp).Row
Worksheets("Catalyst Dump").Columns("D").ColumnWidth = 13

If this post helps click Yes
---------------
Jacob Skaria


"Bishop" wrote:

This code is giving me a Run-time error: '9' Subscript out of range:

Dim CDLastRow As Long 'Catalyst Dump
Dim EDLastRow As Long 'Exported Data

CDLastRow = Workbooks("Test Tally SheetII.xlsm").Worksheets _
("Catalyst Dump").Cells(Rows.Count, "A").End(xlUp).Row
Worksheets("Catalyst Dump").Columns("D").ColumnWidth = 13

Per some previous advice I added the file type to "Test Tally SheetII.xlsm"
Since I'm working in 07 and my sheet is saved as .xlsm I used that instead of
.xls. But it locks up on this line still.