Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tricky one? 1

Status
Not open for further replies.

simoncpage

Programmer
Apr 4, 2002
256
GB
I am using the following sub

Private Sub Worksheet_Change(ByVal Target As Range)

Dim i As Integer, j As Integer, k As Integer, l As Integer, m As Integer

If Target.Cells = Range("reviews") Then
-------------------------
do stuff
-------------------------

Else
End If

End Sub

When I select a select and drag it contents over a number of cells below it - I get an error mismatch with the target cell line - anything I can do to get round this???

Thanks
Simon
 
Hi Simon - try this

If Target.Cells.address = Range("reviews").address Then

Stopped the type mismatch error on my test wb
HTH
Geoff
 
Geoff & Simon,

A warning about using the construct
Code:
If Target.Cells.Address = Range("reviews").Address Then

If you subsequently select and drag cells over the "reviews" range, it destroys this named range with the result that the above code fails (Error 1004 raised).

Regards.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top