PDA

View Full Version : Computing 99% of COl M while cell is in filtered mode.



aligahk06
04-24-2010, 03:51 AM
Dear All,
I have an excel worksheet in filtered mode.I want to calculate 99% of Col M of Existing value.
Col M described as unit price.
Any macro or code in this regard would be deeply welcome.
Note:- This is a sample file only. The number of cell can vary So i am looking for generalized code.


Attachment is for your ref.
Please help.
Rgds,
Aligahk06

mdmackillop
04-24-2010, 05:54 AM
Option Explicit
Sub Do99()
Dim Rng As Range, Cel As Range
Set Rng = Range(Cells(10, 13), Cells(Rows.Count, 13).End(xlUp)).SpecialCells(xlCellTypeVisible)
For Each Cel In Rng
'checking - can be deleted
Cel.Offset(, 4) = Cel
'end checking
Cel.Value = 0.99 * Cel.Value
Next
End Sub