Deuce Bucksman
Board Regular
- Joined
- Jan 17, 2011
- Messages
- 102
Hello!
The code below is missing a very important step: I'm trying to multiply a range of values on the activesheet by 1 based on the users selection. So, if I were to go to the activesheet, highlight the cells, and then run the macro, the selected cells would multiply by -1. Any guidance on what I missed would be greatly appreciated. Thanks!
Sub macrotest()
Dim selectrange As Range
Set selectrange = Selection
selectrange = ActiveCell.Value
For Each cell In selectrange
selectrange = selectrange * -1
Next cell
End Sub
The code below is missing a very important step: I'm trying to multiply a range of values on the activesheet by 1 based on the users selection. So, if I were to go to the activesheet, highlight the cells, and then run the macro, the selected cells would multiply by -1. Any guidance on what I missed would be greatly appreciated. Thanks!
Sub macrotest()
Dim selectrange As Range
Set selectrange = Selection
selectrange = ActiveCell.Value
For Each cell In selectrange
selectrange = selectrange * -1
Next cell
End Sub