how to select blank data in linked cells - VBA

SilentRomance

New Member
Joined
Aug 4, 2021
Messages
46
Office Version
  1. 2016
  2. 2010
Platform
  1. Windows
Hi guys,
how to select blank data in linked cells.
This is my sample data in Sheet 1
13-Aug-21
13-Aug-21
13-Aug-21
13-Aug-21

And this is the Formulas in Sheet 2
=IF('Sheet1'!A1 = FALSE, "",'Sheet1'!A1)
=IF('Sheet1'!A2 = FALSE, "",'Sheet1'!A2)
=IF('Sheet1'!A3 = FALSE, "",'Sheet1'!A3)
=IF('Sheet1'!A4 = FALSE, "",'Sheet1'!A4)
=IF('Sheet1'!A5 = FALSE, "",'Sheet1'!A5)
=IF('Sheet1'!A6 = FALSE, "",'Sheet1'!A6)
=IF('Sheet1'!A7 = FALSE, "",'Sheet1'!A7)

Output in sheet 2
13-Aug-21
13-Aug-21
13-Aug-21
13-Aug-21

And i want to select those blank data to delete it or color it.
How do i do it in VBA?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
You want to Blank cell at Sheet1!? Is this Correct?
 
Upvote 0
Try this:
VBA Code:
Sub Macro2()
Dim Lr&
    Lr = Sheets("Sheet2").Range("A1").End(xlDown).Row
    Sheets("Sheet2").Range("A1:A" & Lr).Interior.Color = xlNone
    Sheets("Sheet2").Range("A1:A" & Lr).SpecialCells(xlCellTypeFormulas, 22).Interior.Color = vbRed
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,246
Members
452,623
Latest member
cliftonhandyman

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