Hello all,
I tried this once before and it was poorly worked out. I requested it be removed. Apologies for the dup.
I feel like an intermediate user but functions in VBA with complicated multi-step equations, and in this case with variable cell references has got my mind reeling.
Its probably much simpler than I'm thinking or my lack of experience shows in not having really executed similar code in the past.
Basically (forgive the lack of proper syntax, just trying to get the idea across):
Equation:
a = ((( b ^ ( c-d )) / e) )/ 1000
Where:
ouch = sheets("a").range("a20:a1000")
For Each cell in range ouch
a = cell.offset(0, 1)
b = sheets("b").range("m12")
c = sheets("b").range("m11")
d = cell.offset(0, 2)
e = sheets("b").range("p2")
*note any cell.offset is on sheet "a" and all other values are on sheet "b"
Now for the ...far from fluent... code I have tried and failed with because I'm inexperienced with these.
I know, laughable... but hey, logically it makes sense to me -- just in the wrong language.
Alternatively I tried with functions:
Thank you all for you time in checking this out and any assistance or guidance that may be offered! Cheers!
I tried this once before and it was poorly worked out. I requested it be removed. Apologies for the dup.
I feel like an intermediate user but functions in VBA with complicated multi-step equations, and in this case with variable cell references has got my mind reeling.
Its probably much simpler than I'm thinking or my lack of experience shows in not having really executed similar code in the past.
Basically (forgive the lack of proper syntax, just trying to get the idea across):
Equation:
a = ((( b ^ ( c-d )) / e) )/ 1000
Where:
ouch = sheets("a").range("a20:a1000")
For Each cell in range ouch
a = cell.offset(0, 1)
b = sheets("b").range("m12")
c = sheets("b").range("m11")
d = cell.offset(0, 2)
e = sheets("b").range("p2")
*note any cell.offset is on sheet "a" and all other values are on sheet "b"
Now for the ...far from fluent... code I have tried and failed with because I'm inexperienced with these.
VBA Code:
Dim StdRng As Range
Set StdRng = Sheets("CopyStandardDataHere").Range("C3:J6")
Dim trgts As Range
Set trgts = Sheets("Export").Range("B21:B3092")
For Each cell In StdRng
If cell.Value <> "" Then
For Each cell2 In trgts
If cell2.Value = "WH-V-8" Then
cell2.Offset(0, 4) = (((Sheets("CopyStandardDataHere").Range("D$12") ^ (Sheets("CopyStandardDataHere").Range("D$11") - cell2.Offset(0, 1))) / Sheets("CopyStandardDataHere").Range("$M$2")) / 1000)
End If
Next
End If
Next
I know, laughable... but hey, logically it makes sense to me -- just in the wrong language.
Alternatively I tried with functions:
VBA Code:
Dim StdRng As Range
Set StdRng = Sheets("CopyStandardDataHere").Range("C3:J6")
Dim trgts As Range
Set trgts = Sheets("Export").Range("B21:B3092")
Dim WHV8Eamp As Range
Set WHV8Emp = Sheets("CopyStandardDataHere").Range("C$12")
Dim WHV8Int As Range
Set WHV8Int = Sheets("CopyStandardDataHere").Range("C$11")
Dim RxnVol As Range
Set RxnVol = Sheets("CopyStandardDataHere").Range("$M$2")
For Each cell In StdRng
If cell.Value <> "" Then
For Each cell2 In trgts
If cell2.Value = "WH-V-8" Then
cell2.Offset(0, 4) = "=Quotient ("=Quotient ("=POWER (WHV8Eamp, "=WHV8Int-coffset")", RxnVol"), 1000"
End If
Next
End If
Next
Thank you all for you time in checking this out and any assistance or guidance that may be offered! Cheers!