C
Colin Hayes
Hi All
Don Guillett kindly made some code to change the content of a column of
numbers :
Sub Add_Subtract_Multiply_Divide_Selected_Column()
Selection.NumberFormat = "0.00"
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",
"Price Variation")
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 - Please Try Again."
Exit Sub
End Select
row1value = Cells(1, mc)
Cells(1, mc) = InputBox("Vary Number By How Much?", "Price Variation")
Cells(1, mc).Copy
Range(Cells(2, mc), Cells(lr, mc)).PasteSpecial _
Paste:=xlPasteAll, Operation:=x
Application.CutCopyMode = False
Cells(1, mc) = row1value
Selection.NumberFormat = "0.00"
'
End Sub
I need this to have a popup to request a value below which the
calculation will not go.
For example , having entered the operator into the first popups , I need
an extra one asking me for a lower limit. If I entered say 3.50 into
this popup then the calculation would not later below this number.
Example - before
3
3.5
4
4.5
5
5.5
6
6.5
Popup to subtract 2.5 , but with a lower limit of 3
After
3
3
3
3
3
3
3.5
4
Gratfeul fo any assistance.
Best Wishes
Colin
Don Guillett kindly made some code to change the content of a column of
numbers :
Sub Add_Subtract_Multiply_Divide_Selected_Column()
Selection.NumberFormat = "0.00"
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",
"Price Variation")
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 - Please Try Again."
Exit Sub
End Select
row1value = Cells(1, mc)
Cells(1, mc) = InputBox("Vary Number By How Much?", "Price Variation")
Cells(1, mc).Copy
Range(Cells(2, mc), Cells(lr, mc)).PasteSpecial _
Paste:=xlPasteAll, Operation:=x
Application.CutCopyMode = False
Cells(1, mc) = row1value
Selection.NumberFormat = "0.00"
'
End Sub
I need this to have a popup to request a value below which the
calculation will not go.
For example , having entered the operator into the first popups , I need
an extra one asking me for a lower limit. If I entered say 3.50 into
this popup then the calculation would not later below this number.
Example - before
3
3.5
4
4.5
5
5.5
6
6.5
Popup to subtract 2.5 , but with a lower limit of 3
After
3
3
3
3
3
3
3.5
4
Gratfeul fo any assistance.
Best Wishes
Colin