Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Using the Lastrow variable in a Count/Countif formula
maybe:
Range("D1").Formula = "=COUNT(""M5:M" & bb & """)" 'or Range("D1").Formula = "=COUNT(""M" & 5 & ":M" & bb & """)" Trevor Shuttleworth wrote: John try: Range("D1").Formula = "=COUNT(""M5:M"" & bb)" Regards revor "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 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
More than one variable for Countif | Excel Worksheet Functions | |||
Count with 1 variable & 1 constant criteria formula | Excel Worksheet Functions | |||
countif using two variable | Excel Discussion (Misc queries) | |||
Formula format for Count or Countif funtion with two criterias | Excel Worksheet Functions | |||
Go to lastrow using other column's lastrow | Excel Programming |