ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   This code won't work, any ideas? (https://www.excelbanter.com/excel-programming/331028-code-wont-work-any-ideas.html)

Santiago[_2_]

This code won't work, any ideas?
 
I'm pretty new with programming in excel. I'd like to know why the following
code does not insert the formula in the cell "P" & fila. Fila is a variable
(number) that changes in a loop.


Range("P" & fila).Formula = "=IF(H" & fila & "="",IF(G" & fila & "="","",G"
& fila & "-E" & fila & "),H" & fila & "-E" & fila & ")"

Thanks!

Bregards

Santiago

Tom Ogilvy

This code won't work, any ideas?
 
Range("P" & fila).formula = "=IF(H" & fila & "="""",IF(G" & fila & _
"="""","""",G" & fila & "-E" & fila & "),H" & fila & "-E" & fila & ")"

--
Regards,
Tom Ogilvy


"Santiago" wrote in message
...
I'm pretty new with programming in excel. I'd like to know why the

following
code does not insert the formula in the cell "P" & fila. Fila is a

variable
(number) that changes in a loop.


Range("P" & fila).Formula = "=IF(H" & fila & "="",IF(G" & fila &

"="","",G"
& fila & "-E" & fila & "),H" & fila & "-E" & fila & ")"

Thanks!

Bregards

Santiago




Santiago[_2_]

This code won't work, any ideas?
 
thanks, got it perfectly.

regards

"Tom Ogilvy" wrote:

Range("P" & fila).formula = "=IF(H" & fila & "="""",IF(G" & fila & _
"="""","""",G" & fila & "-E" & fila & "),H" & fila & "-E" & fila & ")"

--
Regards,
Tom Ogilvy


"Santiago" wrote in message
...
I'm pretty new with programming in excel. I'd like to know why the

following
code does not insert the formula in the cell "P" & fila. Fila is a

variable
(number) that changes in a loop.


Range("P" & fila).Formula = "=IF(H" & fila & "="",IF(G" & fila &

"="","",G"
& fila & "-E" & fila & "),H" & fila & "-E" & fila & ")"

Thanks!

Bregards

Santiago






All times are GMT +1. The time now is 09:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com