ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Syntax for Countnig Rows (https://www.excelbanter.com/excel-programming/301406-syntax-countnig-rows.html)

pete

Syntax for Countnig Rows
 
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.

Frank Kabel

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


--
Regards
Frank Kabel
Frankfurt, Germany


Pete wrote:
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.




All times are GMT +1. The time now is 12:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com