meakashgfx
New Member
- Joined
- Dec 9, 2014
- Messages
- 33
Dear all,
I am trying to paste a formula in a range it says "can not execute in break mode". Please take a look into my code below.
Thanks in advance!
I am trying to paste a formula in a range it says "can not execute in break mode". Please take a look into my code below.
Code:
Dim lngMyRow As Long
Dim lngStartRow As Long
Dim lngLastRow As Long
Dim rngMyRange As Range
Application.ScreenUpdating = False
lngLastRow = Cells(Rows.Count, "C").End(xlUp).Row
For lngMyRow = 1 To lngLastRow
If Len(Range("C" & lngMyRow)) > 0 Then
lngStartRow = lngMyRow
Exit For
End If
Next lngMyRow
Set rngMyRange = Range("D" & lngStartRow & ":D" & lngLastRow)
Range("D2,E2").Copy
Range(rngMyRange.Address).Select
Selection.PasteSpecial
Range("B:B,C:C").Select
Selection.Delete Shift:=xlToLeft
Range("A1").Select
'MsgBox rngMyRange.Address
Application.ScreenUpdating = True
Thanks in advance!