![]() |
Using the Lastrow variable in a Count/Countif formula
Here's what I'm trying to do:
1. Find the lastrow with data in it: bb = Cells(Rows.Count, "B").End(xlUp).Row (OK) 2. Next use variable bb as part of a COUNT formula in cell D1: Range("D1").Formula = "=COUNT("M" & 5 & ":M" & bb)" The error I receive is: Compile error -- expected End of Statement Please help Thanks John |
Using the Lastrow variable in a Count/Countif formula
John
try: Range("D1").Formula = "=COUNT(""M5:M"" & bb)" Regards Trevor "John" wrote in message m... Here's what I'm trying to do: 1. Find the lastrow with data in it: bb = Cells(Rows.Count, "B").End(xlUp).Row (OK) 2. Next use variable bb as part of a COUNT formula in cell D1: Range("D1").Formula = "=COUNT("M" & 5 & ":M" & bb)" The error I receive is: Compile error -- expected End of Statement Please help Thanks John |
All times are GMT +1. The time now is 01:36 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com