I have some VBA code that at the press of a button it executes a Sub consisting of a bunch of If then statements that look like this...
This was working beautifully, until it wasn't. I use StatusCol as the range for each If Then statement and it seemed to be working as I said perfectly. Then all of a sudden it now won't paste onto Worksheet Two until I press the ENTER key and even once that is done it will only paste a certain portion of the If then statements where-as about 20 minutes ago it was posting everything properly. The first times it didn't work properly I would see the pasting happen on the sheet, then it would just disappear and leave me with either nothing or one line copied and pasted properly. What am I missing here?
VBA Code:
Dim StatusCol As Range
If AAAAAA = True Then
Set StatusCol = Worksheets("One").Range("D3:D500").Find("XXXXXX", , xlValues, xlWhole, , , False)
If Not StatusCol Is Nothing Then
Worksheets("One").Range(StatusCol.Address).Offset(, -2).Resize(3, 6).Copy
Worksheets("Two").Range("D500").End(xlUp).Offset(1, -2).PasteSpecial
End If
End If
This was working beautifully, until it wasn't. I use StatusCol as the range for each If Then statement and it seemed to be working as I said perfectly. Then all of a sudden it now won't paste onto Worksheet Two until I press the ENTER key and even once that is done it will only paste a certain portion of the If then statements where-as about 20 minutes ago it was posting everything properly. The first times it didn't work properly I would see the pasting happen on the sheet, then it would just disappear and leave me with either nothing or one line copied and pasted properly. What am I missing here?