dmartin72724
New Member
- Joined
- Jun 12, 2017
- Messages
- 2
Hello - first time poster, long time reader. I am having difficulty with the second copy/paste functionality in a macro. Basically, when a 'complete' button is hit, the macro should copy from sheet A and past on sheet C, and then copy sheet B and paste on sheet B. Pretty basic stuff. This macro stopped working about a week ago and I cant figure out why! It worked for about 15 days, then has not since.
I have basic to intermediate knowledge of VBA and the current excel project is my largest project by far. I have about 30 macros doing various things. Anyway, would love any suggestions, and thanks for your assistance.
First I tried:
Sub Paste_Recon_Final_Data()
End Sub
Then I tried inserting Application.CutCopyMode = False in between the two copies. That didnt work.
Then I tried it the same, but different way:
Sub testCompleteRecon
End Sub
I also tried the Application.CutCopyMode = False in between both copies.
The third was to separate the code into two macros and run them in 1 macro. I recorded it and noticed again that Excel recorder put "Application.CutCopyMode = False" in between the two macros. I tried both with and without this, and it did not work when I ran it again.
What gives? And thanks in advance for your help!
****** id="cke_pastebin" style="position: absolute; top: 600px; width: 1px; height: 1px; overflow: hidden; left: -1000px;"> Application.CutCopyMode = False
I have basic to intermediate knowledge of VBA and the current excel project is my largest project by far. I have about 30 macros doing various things. Anyway, would love any suggestions, and thanks for your assistance.
First I tried:
Sub Paste_Recon_Final_Data()
Application.ScreenUpdating = False
Worksheets("EqyData").Range("A3:Z1000").Clear
Worksheets("SwapData").Range("A3:Z1000").Clear
Worksheets("Eqy Pos-Prime").Range("A2:Z1000").Copy
With Sheets("EqyData")
Worksheets("EqyData").Range("A3:Z1000").Clear
Worksheets("SwapData").Range("A3:Z1000").Clear
Worksheets("Eqy Pos-Prime").Range("A2:Z1000").Copy
With Sheets("EqyData")
.Range("A3").PasteSpecial xlPasteValues
.Range("A3").Select
.Range("A3").Select
End With
Worksheets("Swap Pos-Prime").Range("A2:AV1000").Copy
With Sheets("SwapData")
Worksheets("Swap Pos-Prime").Range("A2:AV1000").Copy
With Sheets("SwapData")
.Range("A3").PasteSpecial xlPasteValues
.Range("A3").Select
.Range("A3").Select
End With
Application.CutCopyMode = False
ActiveWorkbook.RefreshAll
Application.ScreenUpdating = True
MsgBox "Recon Macro is complete"
Application.CutCopyMode = False
ActiveWorkbook.RefreshAll
Application.ScreenUpdating = True
MsgBox "Recon Macro is complete"
End Sub
Then I tried inserting Application.CutCopyMode = False in between the two copies. That didnt work.
Then I tried it the same, but different way:
Sub testCompleteRecon
Worksheets("EqyData").Range("A3:AZ1000").Clear
Worksheets("Eqy Pos-Prime").Range("A2:Z1000").Copy
Worksheets("EqyData").Range("A3").PasteSpecial xlPasteValues
Worksheets("SwapData").Range("A3:AV1000").Clear
Worksheets("Swap Pos-Prime").Range("A2:AV1000").Copy
Worksheets("SwapData").Range("A3").PasteSpecial xlPasteValues
Application.CutCopyMode = False
ActiveWorkbook.RefreshAll
Application.ScreenUpdating = True
Worksheets("Eqy Pos-Prime").Range("A2:Z1000").Copy
Worksheets("EqyData").Range("A3").PasteSpecial xlPasteValues
Worksheets("SwapData").Range("A3:AV1000").Clear
Worksheets("Swap Pos-Prime").Range("A2:AV1000").Copy
Worksheets("SwapData").Range("A3").PasteSpecial xlPasteValues
Application.CutCopyMode = False
ActiveWorkbook.RefreshAll
Application.ScreenUpdating = True
MsgBox "Recon Macro is complete"
End Sub
I also tried the Application.CutCopyMode = False in between both copies.
The third was to separate the code into two macros and run them in 1 macro. I recorded it and noticed again that Excel recorder put "Application.CutCopyMode = False" in between the two macros. I tried both with and without this, and it did not work when I ran it again.
What gives? And thanks in advance for your help!
****** id="cke_pastebin" style="position: absolute; top: 600px; width: 1px; height: 1px; overflow: hidden; left: -1000px;"> Application.CutCopyMode = False