-1

Using VBA, I'm making a sub that should, in some instances, output maybe hundreds of strings. Can I make a long MsgBox where all of those strings are occupying a different paragraph each? In my workbook, the worksheets have tables with the code of a product in the first column and the stock in the eighth (last), I have made the function AverageStock that returns the average stock of a certain product code in a worksheet.

Sub test()

Dim product_code as String
Dim LRow as Integer
Dim k as Integer

LRow = Range("A3").End(xlDown).Row
product_code = InputBox("Product Code")

For k = 3 To LRow
        If Cells(k, 8) > AverageStock(product_code) Then

I only have this till now, any help/suggestions?

1 Answers1

1

MsgBox will only contain text and a title: https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/msgbox-function

The option you have is to create a custom UserForm.

Timothy Alexis Vass
  • 2,526
  • 2
  • 11
  • 30