Yjmmay34
07-29-2010, 11:45 PM
Hi, all. when i use the formula below:
ActiveSheet.Cells(i, 197) = "=if( SUM(IA" & StartRow & ":IA" & i - 1 & ") =0 , 0,(SUMPRODUCT(IA" & StartRow & ":IA" & i - 1 & ",GO" & StartRow & ":GO" & i - 1 & "))/SUM(IA" & StartRow & ":IA" & i - 1 & "))"
i know the" IA " represent the column.But how about if i cannot comfirm the exact column, which means the column is changing based on some condition, like below, variable "x" will represent the column.
x = 13
Do While x <= 27
If range("GO3").Value = Cells(4, x).Value Then
If range("GO4").Value = Cells(5, x).Value Then
then how should i put "x" instead of "IA" to the formula??
Thank you!
ActiveSheet.Cells(i, 197) = "=if( SUM(IA" & StartRow & ":IA" & i - 1 & ") =0 , 0,(SUMPRODUCT(IA" & StartRow & ":IA" & i - 1 & ",GO" & StartRow & ":GO" & i - 1 & "))/SUM(IA" & StartRow & ":IA" & i - 1 & "))"
i know the" IA " represent the column.But how about if i cannot comfirm the exact column, which means the column is changing based on some condition, like below, variable "x" will represent the column.
x = 13
Do While x <= 27
If range("GO3").Value = Cells(4, x).Value Then
If range("GO4").Value = Cells(5, x).Value Then
then how should i put "x" instead of "IA" to the formula??
Thank you!