chris123321
IS-IT--Management
If I have values in column A that need to be multiplied by 10, how do I do that?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I reckon you should try:relaxyz said:How can I do it in MS Word?
Sub UpdateCellValues()
Dim a As Variant
Dim b As String
Dim c As String
Dim d As Variant
Dim e As String
e = "Please select one or more table cells before running this macro."
Dim oCell As Cell
With Selection
If .Information(wdWithInTable) = True Then
If Selection.Range.Text = "" Then
MsgBox e
Exit Sub
End If
a = InputBox("Please input the amount by which to vary the cell values.")
b = InputBox("Please indicate the required action: (A)dd, (S)ubtract, (M)ultiply or (D)ivide?")
c = InputBox("Skip Blanks? (Y/N)")
For Each oCell In .Cells
d = Left(oCell.Range.Text, Len(oCell.Range.Text) - 2)
If UCase(Left(c, 1)) = "N" Then
If d = "" Then d = "0"
End If
If IsNumeric(d) = True Then
If UCase(Left(b, 1)) = "A" Then oCell.Range.Text = d * 1 + a
If UCase(Left(b, 1)) = "S" Then oCell.Range.Text = d * 1 - a
If UCase(Left(b, 1)) = "M" Then oCell.Range.Text = d * a
If UCase(Left(b, 1)) = "D" Then oCell.Range.Text = d / a
End If
Next oCell
Else
MsgBox e
End If
End With
End Sub
If it is simply a matter of not displaying 0, then you have couple of other options ...how about if some cells are empty in the column and after multiplying by 10 I dont want to have 0 displayed in those empty cells
Within Word, you can insert an EXCEL Worksheet Object, create your Table, and do the Edit--Multiply operation, and when you are done, click outside the worksheet layout, you will have the table created in the Word document, but with the added feature that it is still editable as an EXCEL Worksheet Object.How can I do it in MS Word?