Thread: If Macro
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Sal Sal is offline
external usenet poster
 
Posts: 84
Default If Macro

This is really good stuff. Thank you very much.

"Don Guillett" wrote:

try

Sub ifcolaandbblank()
If WorksheetFunction.CountA(Columns("a:b")) 0 Then
'do this
Else
On Error GoTo nono
Application.DisplayAlerts = False
Sheets("sheet3").Delete
Sheets("sheet3a").Delete
Application.DisplayAlerts = True
End If
Exit Sub
nono:
MsgBox "not there"
End Sub--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Sal" wrote in message
...
Is there a macro that will say if Column A and Column B on Sheet3 have
contents follow this code€¦

I am going to put a long code here

But if Column A and Column B do not have contents follow this code

application.displayalerts = false
Sheets("Sheet3").Delete
Sheets("Sheet3a").Delete
application.displayalerts = true

End Sub