Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-05-2015, 12:54 AM
macropod's Avatar
macropod macropod is offline Excel vba to check to check if two columns are empty Windows 7 64bit Excel vba to check to check if two columns are empty Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For a basic report, you could use code like:
Code:
Dim lRow As Long, bEmpty As Boolean
lRow = ThisWorkbook.ActiveSheet.UsedRange.Cells.SpecialCells(xlCellTypeLastCell).Row
bEmpty = True
With Selection
  If .Rows(1).Row < lRow Then
    If ThisWorkbook.ActiveSheet.Range("A" & .Rows(1).Row & ":B" & .Rows(.Rows.Count).Row).SpecialCells(xlCellTypeBlanks).Count _
      < .Rows.Count * 2 Then bEmpty = False
  End If
  If bEmpty = True Then
    MsgBox "All rows in columns A & B in the selected rows are empty."
  Else
    MsgBox "At least one row in columns A & B iin the selected rows is not empty."
  End If
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]

Last edited by macropod; 07-05-2015 at 01:13 AM. Reason: Enhanced code
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel vba to check to check if two columns are empty Check boxes that insert data from Excel spc94 Word VBA 1 06-22-2015 01:46 PM
Multiple Check In/check Out Times big0 Excel 4 09-19-2013 05:02 AM
Excel vba to check to check if two columns are empty cannot check/uncheck check box but added check box learn2office Word 1 11-27-2012 02:02 AM
Link word check box to access check box Mrkieth Word 4 01-30-2012 06:43 AM
Need Help with Using a Check Box Nick9589 Excel 1 05-01-2010 09:29 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 06:20 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft