Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Intersect or Union?
Maybe:
For Each cell In Sheets(1).UsedRange If Application.Intersect(cell, Range("I44:N55")) Is Nothing Then cell.Copy cell.PasteSpecial xlPasteValues End If Next cell Your idea to deselect an area from the used range will only work if the area to be excluded from copy/paste is at the edged of the used range because copy and paste ranges have to be rectangular. Above code will work with any range. Cheers, Joerg Mochikun "Nigel" wrote in message ... I have an application that copies the used range on a worksheet and then pastes values, to remove formula. I need to deselect a smaller range within the used range before I paste values, so for the smaller range the formula are retained. The following replaces all formula, but if I wanted to exclude a smaller range say ("I44:N55") how could I do this? With Sheets(1).UsedRange .Cells.Copy .Cells.PasteSpecial xlPasteValues End With -- Regards, Nigel |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Complex Union Intersect | Excel Worksheet Functions | |||
Intersect | Excel Programming | |||
Equivalent of Minus in Excel. Also Union, Intersect. | Excel Programming | |||
Equivalent of Minus in Excel. Also Union, Intersect. | Excel Worksheet Functions | |||
Intersect, Union... where's Deduct? | Excel Programming |