Jav_uk8

New Member
Joined
Jan 12, 2017
Messages
22
Hi All,

I need help on the following VBA code.

I need to amend the formula below into a VBA code. I need to amend the 'O2:O662' section to show O2:O" & lastrow (used in previous VBA) or something that will work.

=CONCATENATE("Number of Cases"," ",COUNTIF(O2:O662,">=£0.01")," ","out of"," ",COUNTA(O2:O662))

Hope this makes sense?

Cheers :)
 
Last edited:

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Say you want to place this formula in cell A1. Then assuming you have already calculated lastrow, you would just use:
Code:
Range("A1").Formula = "=CONCATENATE(""Number of Cases"","" "",COUNTIF(O2:O" & lastrow & ","">=£0.01""),"" "",""out of"","" "",COUNTA(O2:O" & lastrow & "))"
If you have not already calculated lastrow, you would do so like this:
Code:
Dim lastrow as Long
lastrow = Cells(Rows.Count,"O").End(xlUp).Row
 
Upvote 0

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top