COUNTA Counting "Blank" Cells

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
582
Office Version
  1. 365
I have a spreadsheet covering A to THG, and 1000+ rows deep.

WHen I use COUNTA on a row, its counting "blank" cells. All cells (when it has been exported" have come as "TEXT".

It will take a long time (and have another sheet about 20x as big with the same issue.

TEXT TO COLUMNS works but will take an age going through each column individually.

Is there either a macro I can have do this (starting column M through to THG?

(Have also use Replace "" with "+++++" but again, this solution will take an absolute age.

If I use
Excel Formula:
=CODE(THG235)
for example it comes up as #VALUE!

I am guessing a macro that could run doing the Text To Columns is the best solution? If so, ohw would I go about this.

Welcome to other ideas!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Maybe
VBA Code:
Sub surkdidat()
   With Range("M2:THG" & Range("A" & Rows.Count))
      .Value = .Value
   End With
End Sub
 
Upvote 0
Maybe
VBA Code:
Sub surkdidat()
   With Range("M2:THG" & Range("A" & Rows.Count))
      .Value = .Value
   End With
End Sub
Comes up with Error 400. i have tried to add a row number after THG, but even if I do this, is still counting "blank" cells. When I go into the cell, there is no obvious space or character in them
 
Upvote 0
Is there any particular column that will always have data on the last row?
 
Upvote 0
Ok, how about
VBA Code:
Sub surkdidat()
   Dim UsdRws As Long
   
   UsdRws = Cells.Find("*", , , , xlByRows, xlPrevious, , , False).Row
   With Range("M2:THG" & UsdRws)
      .Value = .Value
   End With
End Sub
 
Upvote 0
Solution
Ok, how about
VBA Code:
Sub surkdidat()
   Dim UsdRws As Long
  
   UsdRws = Cells.Find("*", , , , xlByRows, xlPrevious, , , False).Row
   With Range("M2:THG" & UsdRws)
      .Value = .Value
   End With
End Sub
Thanks Fluff! All seems to work on the smaller sheet! Again, you have been very helpful :)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,912
Messages
6,122,204
Members
449,072
Latest member
DW Draft

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