ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PasteSpecial (https://www.excelbanter.com/excel-programming/312728-pastespecial.html)

Kevin

PasteSpecial
 
I am using past special to paste a formula into a cell
range. My code is as follows:

With Worksheets(1)
.Range(Cells(40, 2), Cells(51, 2)).Copy
.Range(Cells(curRow, colCount + 1), Cells(maxRow,
colCount + 2)).PasteSpecial _
Paste:=xlPasteFormulas
End With

curRow, colcount and maxRow are all variables set
dynamically. This works but I get a message I have to
respond to that asks if I want to replace the contents in
the destination cell. Can I turn that off?


Bob Umlas[_3_]

PasteSpecial
 
precede the code with
Application.displayalerts = False
Bob Umlas
Excel MVP

"Kevin" wrote in message
...
I am using past special to paste a formula into a cell
range. My code is as follows:

With Worksheets(1)
.Range(Cells(40, 2), Cells(51, 2)).Copy
.Range(Cells(curRow, colCount + 1), Cells(maxRow,
colCount + 2)).PasteSpecial _
Paste:=xlPasteFormulas
End With

curRow, colcount and maxRow are all variables set
dynamically. This works but I get a message I have to
respond to that asks if I want to replace the contents in
the destination cell. Can I turn that off?




Bob Phillips[_6_]

PasteSpecial
 
try Application.DisplayAlerts = False before it and reset to True after

--

HTH

RP

"Kevin" wrote in message
...
I am using past special to paste a formula into a cell
range. My code is as follows:

With Worksheets(1)
.Range(Cells(40, 2), Cells(51, 2)).Copy
.Range(Cells(curRow, colCount + 1), Cells(maxRow,
colCount + 2)).PasteSpecial _
Paste:=xlPasteFormulas
End With

curRow, colcount and maxRow are all variables set
dynamically. This works but I get a message I have to
respond to that asks if I want to replace the contents in
the destination cell. Can I turn that off?




Kevin

PasteSpecial
 
Thanks Guys! That worked great!

Thanks Again!

Kevin
-----Original Message-----
I am using past special to paste a formula into a cell
range. My code is as follows:

With Worksheets(1)
.Range(Cells(40, 2), Cells(51, 2)).Copy
.Range(Cells(curRow, colCount + 1), Cells(maxRow,
colCount + 2)).PasteSpecial _
Paste:=xlPasteFormulas
End With

curRow, colcount and maxRow are all variables set
dynamically. This works but I get a message I have to
respond to that asks if I want to replace the contents in
the destination cell. Can I turn that off?

.



All times are GMT +1. The time now is 08:26 PM.

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