why is it wrong??????
How can i fix this?![]()
IIf(Cells(Row, Column) = "", Cells(Row, Column + 3) = "", Cells(Row, Column + 3) = Cells(Row, Column + 1) - Cells(Row, Column)) = Cells(Row, Column)
thnx
why is it wrong??????
How can i fix this?![]()
IIf(Cells(Row, Column) = "", Cells(Row, Column + 3) = "", Cells(Row, Column + 3) = Cells(Row, Column + 1) - Cells(Row, Column)) = Cells(Row, Column)
thnx
Last edited by alansidman; 05-26-2014 at 08:56 AM. Reason: code tags added
1) (order) Please use code tags (in future and edit above post)
2) (merit) The whole sentence will return boolean value (true or false) you shall use it within some expression or assign it to a variable or to a cell etc. It cannot be "standalone line of code"
3) (again merit) How to fix? Depends on desired result. May be:
![]()
Cells(Row, Column + 3) = iif ( Cells(Row, Column) = "" , "", Cells(Row, Column + 1) - Cells(Row, Column) )
Best Regards,
Kaper
hi lupingamon,
1. IIf function returns a value not an object
2. You can not assign value to a value, one can assign value to an object
To fix that you need to change for If ... Else construction
Example:
![]()
If Cells(row, column) = "" Then Cells(row, column + 3) = "" ElseIf Cells(row, column) = 0 Then Cells(row, column + 3) = Cells(row, column + 1) - Cells(row, column) Else Cells(row, column + 3) = Cells(row, column) End If
Code Tags Added
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.
Posting code between tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.
Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found at http://www.excelforum.com/forum-rule...rum-rules.html
(Because you are new to the forum, I have added them for you today. Please take a few minutes to read all Forum Rules and comply in the future.)
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks