Run-time Error: '438'

B

Bishop

Why doesn't this work:

For Each wb In Workbooks
'Test to see if wb's name is like "*C&A PF*.xlsm"
If wb.Name Like "*C&A PF*.xlsm" Then
With wb
CDLastRow = .Sheets("Catalyst Dump").Range("A" & Rows.Count) _
& .End(xlUp).Row
.Worksheets("Catalyst Dump").Columns("D").ColumnWidth = 18
End With
End If
Next

The line starting with CDLastRow is giving me the error. Object doesn't
support this property or method.
 
F

FSt1

hi
try this syntax..

CDLastRow = .Sheets("Catalyst Dump").Range("A" & Rows.Count) _
.End(xlUp).Row

basicily, loose the ampersand.
regards
FSt1
 
D

Dave Peterson

You're not concatenating a string here:

CDLastRow = .Sheets("Catalyst Dump").Range("A" & Rows.Count) _
.End(xlUp).Row

The space-underscore is the continuation character for extending one logical
line of code to two physical lines.
 

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

Similar Threads


Top