ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Fill Blank cells in a range (https://www.excelbanter.com/excel-discussion-misc-queries/136313-fill-blank-cells-range.html)

kevcar40

Fill Blank cells in a range
 
Hi
I have a worksheet that i import data onto
i then count the number of rows and store the result in AM1
the problem is some of the cell are blank
What i want to do is check the range
from BH1 to BH (AM1 value) checking for Blank cells
if any are found put the Word "BLANK" in the cell



Thanks


Kevin


macropod

Fill Blank cells in a range
 
Hi Kevin,

Do you really need to fill the empty cells? Whilst you perhaps can't rely on COUNT or COUNTA for this, it occurs to me that what you
probably need is the number of the last data row. If so:
To find the row with the last numeric value in column A, use:
=MATCH(1E+306,A:A,1)
To find the row with the last text value in column A, use:
=MATCH("*",A:A,-1)

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"kevcar40" wrote in message oups.com...
Hi
I have a worksheet that i import data onto
i then count the number of rows and store the result in AM1
the problem is some of the cell are blank
What i want to do is check the range
from BH1 to BH (AM1 value) checking for Blank cells
if any are found put the Word "BLANK" in the cell



Thanks


Kevin



JE McGimpsey

Fill Blank cells in a range
 
One way:

Dim rBlanks As Range
On Error Resume Next
Set rBlanks = Range("BH1:BH" & _
Range("AM1").Value).SpecialCells(xlCellTypeBlanks)
On Error GoTo 0
If Not rBlanks Is Nothing Then rBlanks.Value = "BLANK"

In article .com,
"kevcar40" wrote:

I have a worksheet that i import data onto
i then count the number of rows and store the result in AM1
the problem is some of the cell are blank
What i want to do is check the range
from BH1 to BH (AM1 value) checking for Blank cells
if any are found put the Word "BLANK" in the cell



All times are GMT +1. The time now is 09:23 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com