Last active
April 16, 2017 15:36
-
-
Save ateneva/10dd4cf17b1596895be07d0e5fa3ab73 to your computer and use it in GitHub Desktop.
Restate values by multiplication (will also work for all math operations)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub MultiplyValues() | |
Dim Cell As Range | |
Dim prv As Double | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
'written by Angelina Teneva, September 2016 | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
'multiplies by a 1000 | |
For Each Cell In ActiveSheet.Range("J2:J" & ActiveSheet.UsedRange.Rows.Count).SpecialCells(xlCellTypeVisible) | |
prv = Cell.Value | |
Cell.Value = prv * 1000 '*(-1) | |
Next Cell | |
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
'make values negative | |
For Each Cell In ActiveSheet.Range("AV:AV", "AX:AX") | |
If IsNumeric(Cell) And Cell.Value <> 0 Then | |
prv = Cell.Value | |
Cell.Formula = prv * -1 | |
End If | |
Next Cell | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment