PDA

View Full Version : increase numbers by percent in a specific column



GaryB
09-21-2007, 03:58 PM
Hi.

I am trying to do a global change for a specific column in a workbook. I have a modificatoin to a code that was given to me that does the entire sheet.
Sub increase()
For Each cell In ActiveSheet.UsedRange
cell.Value = cell.Value * 1.05

Next cell
End Sub

But I need this to apply to only one column on the sheet. Thanks for any help with this.

Gary

Bob Phillips
09-21-2007, 04:03 PM
Sub increase()
For Each cell In ActiveSheet.Columns(3)
cell.Value = cell.Value * 1.05

Next cell
End Sub


but you don't need VBA. Put 1.05 in a spare cell and copy it
select the cells to multiply
goto Edit>PasteSpecial and chhose Multiply
exit and clear the 1.05 from the cell

GaryB
09-21-2007, 04:34 PM
Yup! Worked like a charm. Again today I get to thank you.

Gary