How to count number of used cells in the row before empty cell using VBA

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,371
Office Version
  1. 2010
Hello,

I need I VBA, which can count cells with numbers in the column starting from column "F" till first empty cell find in the row (ignoring last used columns) and put result in the column "D"

For example Row6; starting from F6 to M6 (before empty cell) there are 8-used cell
For example Row7; starting from F6 to N7 (before empty cell) there are 6- used cell
For example Row8; starting from F6 to P8 (before empty cell) there are 4- used cell
For example Row9; starting from F6 to K9 (before empty cell) there are 5- used cell

*ABCDEFGHIJKLMNOPQRSTU
1
2
3
4
5
68AB123712202122122
76AC123553647
84AD4590612
95AE1223456
10
11

For more detail the image is attached here.

Thank you all.

I am using Excel 2000

Regards,
Moti
 

Attachments

  • Count Used Cells.png
    Count Used Cells.png
    8.4 KB · Views: 12

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number

Forum statistics

Threads
1,216,095
Messages
6,128,795
Members
449,468
Latest member
AGreen17

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