bazwillrun
New Member
- Joined
- Jan 23, 2010
- Messages
- 34
Yes, that old chestnut....
Excel 2013
Been using this macro for around 7 years on a membership database with no problems whatsoever. Checks data in "current" sheet and adds/changes to corresponding cells in "archive" sheet
Yesterday as usual added a couple of new members to "current" ran macro it kept hanging with the error message as posted.
Databas has 23 cols and 1800 rows.
macro and highlighted line that throws up error below.
Have googled the problem but its not helped me and looked for any obvious issues on database but coming up with nothing.
any help or pointers greatly appreciated...im not a programmer so go easy on me !
thanks.
Sub synchronize()
ActiveSheet.DisplayPageBreaks = False
Dim Rng1 As Range, Dn1 As Range, Rng2 As Range, Dn2 As Range
With Sheets("Current") '1
Set Rng1 = .Range(.Range("D1"), .Range("D" & Rows.Count).End(xlUp))
End With
With Sheets("Archive") '2
Set Rng2 = .Range(.Range("D1"), .Range("D" & Rows.Count).End(xlUp))
End With
For Each Dn2 In Rng2
For Each Dn1 In Rng1
If UCase(Trim(Dn2)) = UCase(Trim(Dn1)) Then
Dn1.Offset(, -3).Resize(, 23).Copy Dn2.Offset(, -3).Resize(, 23)
End If
Next Dn1
Next Dn2
End Sub
Excel 2013
Been using this macro for around 7 years on a membership database with no problems whatsoever. Checks data in "current" sheet and adds/changes to corresponding cells in "archive" sheet
Yesterday as usual added a couple of new members to "current" ran macro it kept hanging with the error message as posted.
Databas has 23 cols and 1800 rows.
macro and highlighted line that throws up error below.
Have googled the problem but its not helped me and looked for any obvious issues on database but coming up with nothing.
any help or pointers greatly appreciated...im not a programmer so go easy on me !
thanks.
Sub synchronize()
ActiveSheet.DisplayPageBreaks = False
Dim Rng1 As Range, Dn1 As Range, Rng2 As Range, Dn2 As Range
With Sheets("Current") '1
Set Rng1 = .Range(.Range("D1"), .Range("D" & Rows.Count).End(xlUp))
End With
With Sheets("Archive") '2
Set Rng2 = .Range(.Range("D1"), .Range("D" & Rows.Count).End(xlUp))
End With
For Each Dn2 In Rng2
For Each Dn1 In Rng1
If UCase(Trim(Dn2)) = UCase(Trim(Dn1)) Then
Dn1.Offset(, -3).Resize(, 23).Copy Dn2.Offset(, -3).Resize(, 23)
End If
Next Dn1
Next Dn2
End Sub