Blanks

tony_d

Board Regular
Joined
Sep 27, 2003
Messages
229
Hi
Got to be a way to do this I filter by column A and it shows if any cells are blank but text in B to G
I manually type in Blank I use a simple macro to do this bit it only works in the last cell is there a better way below is what I use.

ActiveSheet.Range("$A$1:$G$3000").AutoFilter Field:=1, Criteria1:="="
Range("B65000").End(xlUp).Offset(0, -1).Select

ActiveCell.FormulaR1C1 = "Blank"

Any help would be good
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Test this on a COPY of your worksheet

Code:
Option Explicit
Sub BlankIt()
    Dim cel As Range, txt As String, a As Integer
        For Each cel In Range("A1").CurrentRegion.Resize(, 1)
             If Len(cel) = 0 Then
                txt = ""
                For a = 1 To 6
                   txt = txt & cel.Offset(, a).Value
                Next a
                If Len(txt) > 0 Then cel = "Blank"
            End If
        Next cel
End Sub
 
Upvote 0
or simpler ..

Code:
Sub BlankIt2()
    Dim cel As Range
    For Each cel In Range("A1").CurrentRegion.Resize(, 1)
        If Len(cel) = 0 And WorksheetFunction.CountA(cel.Resize(, 6).Offset(, 1)) > 0 Then cel = "Blank"
    Next cel
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,207
Members
452,618
Latest member
Tam84

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