J
JAC
I have correctly applied conditional formatting to a number of cells
on a worksheet belonging to a workbook, involving named ranges and
formulae. All is well.
However, when I copy a range of cells (30 cells) from the worksheet to
another workbook using VBA using the following type of construct, I do
not get the result I desire.
' Paste the values, retaining the original formatting, etc
With rngDest
.PasteSpecial Paste:=xlPasteColumnWidths,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
.PasteSpecial Paste:=xlPasteValuesAndNumberFormats,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End With
The conditions for the conditional formats are carried over, including
the formulae and such named ranges that are essential to satisfy the
conditions.
However, all I intended to do was to carry over the resulting format
that should be applied to the pasted cells, not the conditions or the
formulae.
Does anyone know how I can do this? Can it be done by applying
different parameters to the PasteSpecial method?
Or, will I have to set the formatting myself on the worksheet after
pasting, taking note of the result of the conditional formatting?
Many thanks
on a worksheet belonging to a workbook, involving named ranges and
formulae. All is well.
However, when I copy a range of cells (30 cells) from the worksheet to
another workbook using VBA using the following type of construct, I do
not get the result I desire.
' Paste the values, retaining the original formatting, etc
With rngDest
.PasteSpecial Paste:=xlPasteColumnWidths,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone,
SkipBlanks:=False, Transpose:=False
.PasteSpecial Paste:=xlPasteValuesAndNumberFormats,
Operation:=xlNone, SkipBlanks:=False, Transpose:=False
End With
The conditions for the conditional formats are carried over, including
the formulae and such named ranges that are essential to satisfy the
conditions.
However, all I intended to do was to carry over the resulting format
that should be applied to the pasted cells, not the conditions or the
formulae.
Does anyone know how I can do this? Can it be done by applying
different parameters to the PasteSpecial method?
Or, will I have to set the formatting myself on the worksheet after
pasting, taking note of the result of the conditional formatting?
Many thanks