ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   paste only if destination cell nonblank (https://www.excelbanter.com/excel-programming/360085-paste-only-if-destination-cell-nonblank.html)

edwardpestian[_4_]

paste only if destination cell nonblank
 

I'm using pastespecial to copy values from one range to another. I've
tried setting the skipblanks to true to prevent original blank cells
from overwriting data in destination cells, but I'd rather have it
check to see if the destination cells have data first, and the complete
the pastespecial command. Any ideas?

Thanks.

EP


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=537330


Tom Ogilvy

paste only if destination cell nonblank
 
if isempty(activeCell) then
activecell.pastespecial xlValues
end if

--
Regards,
Tom Ogilvy



"edwardpestian" wrote:


I'm using pastespecial to copy values from one range to another. I've
tried setting the skipblanks to true to prevent original blank cells
from overwriting data in destination cells, but I'd rather have it
check to see if the destination cells have data first, and the complete
the pastespecial command. Any ideas?

Thanks.

EP


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=537330



edwardpestian[_5_]

paste only if destination cell nonblank
 

Once I've implemented all that, I still need the data to be copied based
on two criteria:

Shift: which is a list box containing "Day" "Swing" & "Grave"
And Date, which is a reference to the date in a specific cell.

These two factors need to be found in a range of cells, and then the
values pasted. Basically, I need to have and offset function to find
the cells where the data needs to be pasted.

Below is a formula that I'm using to find the info once it's pasted, so
I need to somehow utilize this to paste the data.

I hope this makes sence.

=IF(Date=0,"",OFFSET($C$6:$C$109,,MATCH(Date,$D$3: $CV$3,0)))

Thanks again..


--
edwardpestian
------------------------------------------------------------------------
edwardpestian's Profile: http://www.excelforum.com/member.php...o&userid=33809
View this thread: http://www.excelforum.com/showthread...hreadid=537330



All times are GMT +1. The time now is 12:17 AM.

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