Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
I am converting some QB code to VBA. Everything works except for converting the following lines of QB code -
FOR I = 1 TO A
IF B(I) > 0 THEN
PRINT "("; C(I); "="; B(I); ")";
These lines screen print the results of part of the programme could look like, for example for an "I" of 4 -
( 1749 = 1 )( 1542 = 1 )( 717 = 2)( 1774 = 1)
What I want to do with VBA is to have the results enter into an Excel cell as text. The best I can come up with is -
For I = 1 To A
If B(i) > 0 Then
result = C(I) & " x " & B(I)
Cells(40 + d, 81) = result
d = d + 1
where "result" is defined as a string. The problem is that I only get the last entry ie. 1774 = 1 so it appears that the others in the loop are overwritten. Can anyone help? The semi-colons seem to be the problem but I can't find an equivalent in VBA.