Making code less column-specific
Hi Don
Yes , I see. This work perfectly and is a very useful application.
Thanks again for your considerable help.
Best Wishes
Colin
In article , Don Guillett
writes
And I was using it to show you the choices. Incorporated here with a choice.
Sub changeallnumbersChooseOperation()
Dim mc, lr As Long
Dim row1value, dowhat, x As String
mc = ActiveCell.Column
lr = Cells(Rows.Count, mc).End(xlUp).Row
If lr = 1 Then Exit Sub
row1value = Cells(1, mc)
Cells(1, mc) = InputBox("Vary Number By How Much?")
dowhat = InputBox("A to add, D to divide, M to multiply, S to subtract")
Select Case UCase(dowhat)
Case "A": x = xlAdd
Case "D": x = xlDivide
Case "M": x = xlMultiply
Case "S": x = xlSubtract
Case Else
MsgBox "Not a choice"
Exit Sub
End Select
Cells(1, mc).Copy
Range(Cells(2, mc), Cells(lr, mc)).PasteSpecial _
Paste:=xlPasteAll, Operation:=x
Application.CutCopyMode = False
Cells(1, mc) = row1value
End Sub
|