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

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
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,224,818
Messages
6,181,152
Members
453,021
Latest member
Justyna P

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