Hello everyone. I'm new here, and pretty new to VBA in general (so I apologize for my clunky code). I have a fairly large workbook (@16mb) with several macros and the other day I went in to edit some of the macros to reflect streamlining and efficiency techniques I've been picking up through self-teaching and web research.....well, now for some reason each time I try to run one of the macros, Excel goes unresponsive ("Excel has stopped working.....") and I cannot for the life of me figure out what I've done to mess this up.
The macros in question are not super complex by any means......the one I am posting below I did f8 through and it seems to be crashing upon the declaration of LastRow as a variable............not sure why. Thoughts? Help is appreciated in advance and I apologize if this duplicates another thread, but I have not been able to find a specific problem like this through search yet....The long and short of this macro is I'm trying to copy formulas down to last populated row and then paste over them as values to save processing effort......
Sub RefreshTransEx()
'
' RefreshTransEx Macro
' RefreshTransEx
'
'
Application.ScreenUpdating = False
Sheets("TransactionExport").Activate
Dim LastRow As Long
With ActiveSheet
LastRow = ActiveSheet.Range("D3").End(xlDown).Row
End With
Range("$A$3:$C$3").Copy
Range("$A$4:$C$" & LastRow).PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("$A$4:$C$" & LastRow).Copy
Range("$A$4:$C$" & LastRow).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("$U$3:$AU$3").Copy
Range("$U$4:$AU$" & LastRow).PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Range("$U$4:$AU$" & LastRow).Copy
Range("$U$4:$AU$" & LastRow).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Application.ScreenUpdating = True
End Sub
Bookmarks