View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Sane Sane is offline
external usenet poster
 
Posts: 3
Default change cellvalue based on value in adjacent cell

On Dec 16, 4:55*pm, Sam Wilson
wrote:
Another thing that may help, put this at the start of the macro:

application.Calculation = xlCalculationManual

and this at the end:
application.Calculation = xlCalculationAutomatic



"Sane" wrote:
In my account data i have amount in column h and Debit, Credit (DR/
CR) *in next column. To modify the values in column h the code is
........
For Each c In Range("H2:h" & t)
* * If c.Offset(0, 1) = "DR" Then
* * c.Value = c
* * Else
* * c.Value = -c
* * End If
* * Next
........
This part of macro takes abnormally high time. Please suggest any
alternative to make this faster.
.- Hide quoted text -


- Show quoted text -


Thanks sam. both put together worked great.