Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Applying change to selected cells
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 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 - Please Try Again." Exit Sub End Select row1value = Cells(1, mc) Cells(1, mc) = InputBox("Vary Number By How Much?") 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 I need a modification of this so that it applies itself just to the range of cells I select within the column , rather than to the whole column. Can someone help with this? Any advice appreciated. Best Wishes |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
applying formulas for all sheets selected | Excel Worksheet Functions | |||
How do i change the color of the selected cells? | Excel Discussion (Misc queries) | |||
how do i change the selected cells color | New Users to Excel | |||
Applying conditional formating to make cells change color | Excel Discussion (Misc queries) | |||
How do I lock selected cells, so only I can change them? | Excel Worksheet Functions |