ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   paste from clipboard after delete cells (https://www.excelbanter.com/excel-programming/383958-paste-clipboard-after-delete-cells.html)

Chris

paste from clipboard after delete cells
 
Hi,

I am writing a macro in Excel 2000

Cells.Select
Selection.Copy

'then move to another sheet in another workbook.
Sheets(currentsheeti).Select
'delete all cell data in the sheet
Cells.Delete

'copy from the clipboard starting at cell A1
Range("A1").Select
ActiveSheet.Paste

Problem : the cells.delete statement clears out the clipboard and so the
activesheet.paste command does not work.

How can delete then still paste the clipboard. Due to order of events it
would be difficult to first delete then copy to clipboard, then paste.

Please advise.

Thanks

Chris

Dave Peterson

paste from clipboard after delete cells
 
sheets(currentsheeti).cells.delete
sheets(othersheetnamehere).cells.copy _
destination:=sheets(currentsheeti).range("a1")



Chris wrote:

Hi,

I am writing a macro in Excel 2000

Cells.Select
Selection.Copy

'then move to another sheet in another workbook.
Sheets(currentsheeti).Select
'delete all cell data in the sheet
Cells.Delete

'copy from the clipboard starting at cell A1
Range("A1").Select
ActiveSheet.Paste

Problem : the cells.delete statement clears out the clipboard and so the
activesheet.paste command does not work.

How can delete then still paste the clipboard. Due to order of events it
would be difficult to first delete then copy to clipboard, then paste.

Please advise.

Thanks

Chris


--

Dave Peterson


All times are GMT +1. The time now is 01:56 AM.

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