Syntax for Countnig Rows

  • Thread starter Thread starter Pete
  • Start date Start date
P

Pete

Within a macro in workbook A I am trying to get the row
count in a worksheet named "Xwalk" in workbook B. I can't
figure out the syntax.

This doesn't work:

NumRowsB = Workbooks("B.xls").Worksheets("Xwalk")!Range
("A1").End(xlDown).Row

Can someone please correct for me.

Thanks.
 
Hi
try
NumRowsB = Workbooks("B.xls").Worksheets("Xwalk").Cells(Rows.Count,
"A").End(xlUp).row
 

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

Back
Top