ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Copy / Paste / ESC Key ? (https://www.excelbanter.com/excel-programming/417999-copy-paste-esc-key.html)

Walter

Copy / Paste / ESC Key ?
 
My code sends data from one tab over to a number of tabs. After doing so I
want it to return to the first tab and be ready for the user to press another
button if needed. But right now when I return the row that was copied still
has the squiggly line around it. I do not want the user to have to press the
ESC key so how do I code that in VBA?

Sub PushData_SupplierName()
'
' PushData Macro
' Push all data from Supp_Data tab to all tabs where this supplier appears

Sheets("Supp_Data").Select
Range("A_named_range").Select
Selection.Copy

'Paste data from supplier on Supp_Data tab to tabs shown below
Sheets("Cir_Conn").Select
Range("C2").Select
ActiveSheet.Paste

Sheets("Backshells").Select
Range("C2").Select
ActiveSheet.Paste

'Return cursor to Supp_Data tab
Sheets("Supp_Data").Select

End Sub

Tim879

Copy / Paste / ESC Key ?
 
add the following line Application.CutCopyMode = False

On Oct 2, 11:55*am, Walter wrote:
My code sends data from one tab over to a number of tabs. *After doing so I
want it to return to the first tab and be ready for the user to press another
button if needed. *But right now when I return the row that was copied still
has the squiggly line around it. *I do not want the user to have to press the
ESC key so how do I code that in VBA?

Sub PushData_SupplierName()
'
' PushData Macro
' Push all data from Supp_Data tab to all tabs where this supplier appears

* * Sheets("Supp_Data").Select
* * Range("A_named_range").Select
* * Selection.Copy

* * 'Paste data from supplier on Supp_Data tab to tabs shown below
* * * * Sheets("Cir_Conn").Select
* * * * Range("C2").Select
* * * * ActiveSheet.Paste

* * * * Sheets("Backshells").Select
* * * * Range("C2").Select
* * * * ActiveSheet.Paste

* * 'Return cursor to Supp_Data tab
* * Sheets("Supp_Data").Select

End Sub




All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com