Hello Experts,
I am having a issue with a Excel Macro that is going back and forth between sheets and copy and pasting columns using the find function. I am runnign into this runtime error 1004 - somthing about the paste area not being the same? Below is my code:
Dim paste_cell As String
Dim copy_cell As String
pv_ModeNotFound = False
Sheets(Sheet).Select
Cells.Find(Award_Col_Heading, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
copy_cell = Cells(ActiveCell.Row + 1, ActiveCell.Column).Select
If ActiveCell <> "" Then
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("SOE Macro Output").Select
Cells.Find(SOE_Col_Heading, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
pv_last_row = Cells(60000, ActiveCell.Column).End(xlUp).Row
paste_cell = Cells(pv_last_row + 1, ActiveCell.Column).Select
'Selection.PasteSpecial paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=
'False, Transpose:=False
ActiveSheet.paste
Else
pv_ModeNotFound = True
End If
End Sub
and it is erroring out at the line ActiveSheet.paste. What I believe is happening is that it is losing what it copied but not sure how to fix it. Have been looking at the computer screen for what seems like hours. Any help would be wonderful.
Thank you!
Amanda Mae
I am having a issue with a Excel Macro that is going back and forth between sheets and copy and pasting columns using the find function. I am runnign into this runtime error 1004 - somthing about the paste area not being the same? Below is my code:
Dim paste_cell As String
Dim copy_cell As String
pv_ModeNotFound = False
Sheets(Sheet).Select
Cells.Find(Award_Col_Heading, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
copy_cell = Cells(ActiveCell.Row + 1, ActiveCell.Column).Select
If ActiveCell <> "" Then
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("SOE Macro Output").Select
Cells.Find(SOE_Col_Heading, After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
pv_last_row = Cells(60000, ActiveCell.Column).End(xlUp).Row
paste_cell = Cells(pv_last_row + 1, ActiveCell.Column).Select
'Selection.PasteSpecial paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:=
'False, Transpose:=False
ActiveSheet.paste
Else
pv_ModeNotFound = True
End If
End Sub
and it is erroring out at the line ActiveSheet.paste. What I believe is happening is that it is losing what it copied but not sure how to fix it. Have been looking at the computer screen for what seems like hours. Any help would be wonderful.
Thank you!
Amanda Mae