View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
mwam423 mwam423 is offline
external usenet poster
 
Posts: 103
Default empty range causes error

good morning, dave. here's code so far, right now it works for each bloc
(there are six), but i'm not sure how to chance the range name, i.e., bloc1,
bloc2, etc. within the a loop. any ideas

Sub consolidated()

Dim testrng As Range
Dim drop As Integer
ActiveSheet.Cells(3, 1).Select

'for counter 1 to 6

Set testrng = Nothing
On Error Resume Next
Set testrng = Range("bloc1")
On Error GoTo errorhandler

If testrng Is Nothing Then
Else:

drop = Range("bloc1").Rows.Count
Range("bloc1").Copy ActiveCell
ActiveCell.Offset(drop, 0).Activate

End If
'Next

errorhandler: Exit Sub

End Sub