View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mark Lincoln Mark Lincoln is offline
external usenet poster
 
Posts: 227
Default Looking for a way to avoid many If/Then statements

This is quick and dirty, but it works. I have this running in a
Module. You'll have to designate the worksheet you're pasting to, as
well as whatever you actually want pasted (I just pasted everything as
is).

Option Explicit


Sub TestForFalse()
Dim c As Object, NoFalses As Boolean
NoFalses = True
For Each c In Range("AE1:BG1")
If c.Value = "False" Then
NoFalses = False
Exit For
End If
Next
If NoFalses Then
Range("AE1:BG1").Copy
'change the next line to suit your destination
'and pasting parameters
Range("AE7:BG7").PasteSpecial (xlPasteAll)
End If
End Sub