Glasgowsmile
Active Member
- Joined
- Apr 14, 2018
- Messages
- 280
- Office Version
- 365
- Platform
- Windows
Good day,
I have the following code below and while it works, I've noticed it copies over the conditional formatting the previous range had which then deletes conditional formatting another range has, so I need to figure out how to stop that and I figured PasteSpecial xlPasteValues was the way to do it but I'm not sure how to implement that into this type of code.
I get an error with this approach. I also tried Range.("").Value and Range("").PasteSpecial Paste:=xlPasteValues
I have the following code below and while it works, I've noticed it copies over the conditional formatting the previous range had which then deletes conditional formatting another range has, so I need to figure out how to stop that and I figured PasteSpecial xlPasteValues was the way to do it but I'm not sure how to implement that into this type of code.
VBA Code:
If Not IsEmpty(Sheet1.Range("$B$5, $G$5, $J$5, $M$5")) Then
With Sheet1
.Range("G2:H2").Copy .Range("K2")
.Range("G5:I32").Copy .Range("K5").PasteSpecial
.Range("C116:L140").Copy .Range("C142")
End With
End If
I get an error with this approach. I also tried Range.("").Value and Range("").PasteSpecial Paste:=xlPasteValues