Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Conditional Calculation

Hi Matt,

Try:

'================
Sub TestIt()
Dim rng As Range, rng2 As Range
Dim rcell As Range
Dim aCell As Range
Dim LRow As Long
Dim rngPlanned As Range
Dim CalcMode As Long

With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With

LRow = Cells(Rows.Count, "E").End(xlUp).Row

Set rng = Range("E2:E" & LRow) '<<==== CHANGE

For Each rcell In rng.Cells
With rcell
If LCase(.Value) = "planned pospects" _
Or LCase(.Value) = "unplanned prospects" Then
Set rng2 = .Offset(0, 15).Resize(1, 12)
rcell.Offset(0, 10).Copy
rng2.PasteSpecial Paste:=xlValues, _
Operation:=xlMultiply, _
SkipBlanks:=False, _
Transpose:=False
End If
End With
Next rcell

With Application
.Calculation = CalcMode
.ScreenUpdating = True
End With
End Sub
'<<================



---
Regards,
Norman



"matpj" wrote in
message ...

Hi Norman,

the actuals start in column T and go until Column AE.
THe values should be replaced by a value equal to the existing value
mulitplied by the value in column O.

but ONLY on rows where column E contains either "Prospects" or
"Unplanned Prospects"

does that make sense?

the code basically needs to scan each row, and when it finds either
value in Column E, then perform the calculation...

thanks for any help,

Matt


--
matpj
------------------------------------------------------------------------
matpj's Profile:
http://www.excelforum.com/member.php...o&userid=21076
View this thread: http://www.excelforum.com/showthread...hreadid=488678



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Conditional Calculation René Excel Discussion (Misc queries) 4 August 4th 09 12:37 AM
Conditional calculation? [email protected] Excel Worksheet Functions 3 January 24th 06 09:01 AM
Conditional Calculation bhofsetz Excel Worksheet Functions 3 July 6th 05 04:04 PM
Calculation conditional on yes no Martin Smith Excel Worksheet Functions 6 May 26th 05 04:46 PM
Help, Multiple conditional calculation wwj New Users to Excel 4 March 10th 05 09:05 PM


All times are GMT +1. The time now is 03:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"