Share via

VBA Loop and If Statement

fiji386 1 Reputation point
2020-08-06T19:12:39.993+00:00

How do I write vba code to run an if statement through multiple lines and each time my value is found, results are populated the number of time value appears. Example on sheet1 cell a1 is 1, cell a2 is 2, cell a3 is 3, cell a4 is 1, cell a5 is 2, cell a6 is 3. on sheet2 every instance a cell = 1 then write text "product sold" on sheet2. so because on sheet1 cells a1 and a4 = 1, then need cells on sheet2 to write text "product sold" on 2 lines.

Community Center | Not monitored
0 comments No comments

1 answer

Sort by: Most helpful
  1. Leon Laude 86,201 Reputation points
    2020-08-07T11:18:22.86+00:00

    Hi,

    Excel development is currently not supported in the Q&A forums, the supported products are listed over here https://learn.microsoft.com/en-us/answers/products (more to be added later on).

    You can ask the experts in the dedicated Excel for developers forum over here:
    https://social.msdn.microsoft.com/forums/en-us/home?forum=exceldev

    ----------

    (If the reply was helpful please don't forget to accept as answer, thank you)

    Best regards,
    Leon

    Was this answer helpful?

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.