Macro to paste special values
Closed
karthikha
Posts
1
Registration date
Friday February 3, 2017
Status
Member
Last seen
February 4, 2017
-
Updated by Ambucias on 4/02/17 at 04:33 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Contributor Last seen December 27, 2022 - Feb 6, 2017 at 11:40 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Contributor Last seen December 27, 2022 - Feb 6, 2017 at 11:40 AM
Related:
- Macro to paste special values
- Facebook special characters - Guide
- How to copy paste youtube link on android - Guide
- Excel online macro - Guide
- Based on the values in cells b77 b88 - Excel Forum
- Excel run macro on open - Guide
1 response
TrowaD
Posts
2921
Registration date
Sunday September 12, 2010
Status
Contributor
Last seen
December 27, 2022
555
Feb 6, 2017 at 11:40 AM
Feb 6, 2017 at 11:40 AM
Hi Karthikha,
The code below will paste the formulas in A1:A3 as value in A1:A3 when all the cells in A4:A400 are the same as the value in A3. Workbook is automatically saved, so you might want to test this code on a copy of your workbook first.
Here is the code:
Best regards,
Trowa
The code below will paste the formulas in A1:A3 as value in A1:A3 when all the cells in A4:A400 are the same as the value in A3. Workbook is automatically saved, so you might want to test this code on a copy of your workbook first.
Here is the code:
Private Sub Workbook_BeforeClose(Cancel As Boolean) If Application.WorksheetFunction.CountIf(Range("A4:A400"), Range("A3").Value) = 397 Then Range("A1:A3").Copy Range("A1:A3").PasteSpecial xlPasteValues End If ActiveWorkbook.Close SaveChanges:=True End Sub
Best regards,
Trowa