Notifications
Clear all
VBA & Macros
4
Posts
2
Users
0
Reactions
1,811
Views
Topic starter
Hello,
This should be very simple but I lack VBA experience. I recorded a macro and then looked at the code it produced but I thought there might be a simpler way to change what I have, below.
Here's a line of code in my workbook:
Range("B1").Value = Range("B2").Value
This copies B2's value to B1.
I want to change this to copy B2's formula only (non-VBA: PasteSpecial/Formula) to B1. How should I rewrite this line of code?
Paul
Posted : 06/08/2019 6:04 pm
Hi Paul,
You can use this
Range("B2").Copy
Range("B1").PasteSpecial xlPasteFormulas
Application.CutCopyMode = False
Regards
Phil
Posted : 06/08/2019 10:59 pm
Topic starter
Thank you, Phil.
Posted : 10/08/2019 7:49 pm
no worries 🙂
Posted : 11/08/2019 3:20 am