• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Selected cells multiply by 1

Code:
Sub Multiply_by_one()
Dim c As Range
For Each c In Selection
  c.Value = c * 1
Next
End Sub

to use
Copy this code to a Code Module in VBA (Alt+F11)
Select a range
Alt+F8
Select Multiply_by_one and press Run
 
Select an empty cell somewhere and put a 1 in it.
Copy that cell into the clipboard (Crtl+C).
Select the cells that you want to multily by 1, right click one of them and choose Paste Special…, in the resultant dialogue box, choose options Values and Multiply, click OK.

In code you might use (after selecting the range):
Code:
Sub blah()
With Range("A1000000")
  .Value = 1
  .Copy
  Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlMultiply, SkipBlanks:=False, Transpose:=False
  .ClearContents
End With
End Sub
where I've used cell A1000000 as an out-of-the-way cell.
 
Back
Top