PDA

View Full Version : [SOLVED] Divide a value by a cell



frade
05-10-2005, 01:52 PM
Hi,

Thanks for your help. Now, I continue my work but I have a new problem
when I divide a value of cell

Please have a look at my code (sheet2)

In a few word, it looks something like this


Dim valB As Long
valB = Worksheets("Sheet1").Range("B1").Value
sFormula = "((H" & i & "/& valB &"))"
Cells(i, "I").Value = Evaluate(sFormula)


But I receive a synthax error...:help

What could I do?

Thanks a lot

Best regards,

Fran?ois

mdmackillop
05-10-2005, 01:59 PM
sFormula = "(H" & i & "/" & valB & ")"

Bob Phillips
05-10-2005, 04:37 PM
Dim valB As Long
valB = Worksheets("Sheet1").Range("B1").Value
sFormula = "((H" & i & "/& valB &"))"
Cells(i, "I").Value = Evaluate(sFormula)




Dim valB As Long
valB = Worksheets("Sheet1").Range("B1").Value
Cells(i, "I").Value = Range("H" & i) / valB

Zack Barresse
05-10-2005, 04:51 PM
xld - some info 4 u I took the liberty of adjusting your post, hope you don't mind. :)

Bob Phillips
05-11-2005, 01:39 AM
xld - some info 4 u I took the liberty of adjusting your post, hope you don't mind. :)
Not at all. Personally, for 2 or 3 lines the tags seem superfluous to me, but that is just my opiniion. But i wish you had fixed that Italic in the original at the same time.:)

Zack Barresse
05-11-2005, 09:24 AM
But i wish you had fixed that Italic in the original at the same time.:)
Not italics, just part of the Quote tags byproduct. :yes

Bob Phillips
05-11-2005, 09:31 AM
Not italics, just part of the Quote tags byproduct. :yes



Of course, just looked odd with code :doh: