+ Reply to Thread
Results 1 to 4 of 4

cycle iif vba

  1. #1
    Registered User
    Join Date
    05-15-2014
    MS-Off Ver
    Excel 2003
    Posts
    25

    cycle iif vba

    why is it wrong??????

    Please Login or Register  to view this content.
    How can i fix this?
    thnx
    Last edited by alansidman; 05-26-2014 at 08:56 AM. Reason: code tags added

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: 2019 but still use also older versions
    Posts
    7,564

    Re: cycle iif vba

    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:
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Forum Guru
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2003
    Posts
    4,168

    Re: cycle iif vba

    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:
    Please Login or Register  to view this content.

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs
    MS-Off Ver
    MS Office 2019
    Posts
    18,738

    Re: cycle iif vba

    Code Tags Added
    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between
    Please Login or Register  to view this content.
    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.)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. VBA Cycle Help
    By Paul.127 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-21-2011, 08:39 AM
  2. cycle for
    By miso.dca in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-07-2009, 09:30 AM
  3. [SOLVED] How do I keep result from 1 iteration cycle to use in next cycle?
    By sgl8akm in forum Excel General
    Replies: 0
    Last Post: 07-27-2006, 03:35 PM
  4. Cycle through worksheets and sum
    By David M C in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2006, 02:10 PM
  5. How do I cycle through all of the worksheets
    By DMB in forum Excel General
    Replies: 1
    Last Post: 01-08-2006, 08:25 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1