skydivetom
New Member
- Joined
- Oct 26, 2017
- Messages
- 5
Experts:
I would like some assistance with tweaking VBA output in a pop-up text box (upon opening Excel)... please see VBA code below:
As of now, the pop-up (data) is driven by values in the actual spreadsheet (I didn't know how to attach the sample file). Right now, the labels (A1:A3) are automatically left aligned. Values from column B, however, are not nicely aligned in the pop-up message. That is, the two currency values (B1:B2) are pushed over due to vbTab. And the % value is not aligned at all.
My question: How can modify the VBA in order to "right-align" any values from **column B** in the pop-up message?
Thank you,
EEH
I would like some assistance with tweaking VBA output in a pop-up text box (upon opening Excel)... please see VBA code below:
As of now, the pop-up (data) is driven by values in the actual spreadsheet (I didn't know how to attach the sample file). Right now, the labels (A1:A3) are automatically left aligned. Values from column B, however, are not nicely aligned in the pop-up message. That is, the two currency values (B1:B2) are pushed over due to vbTab. And the % value is not aligned at all.
My question: How can modify the VBA in order to "right-align" any values from **column B** in the pop-up message?
Thank you,
EEH
Code:
Private Sub Workbook_Open()
Dim strTxt As String
strTxt = _
Worksheets("PopUp Messages").Range("A1").Text & vbTab & Worksheets("PopUp Messages").Range("B1").Text & vbCrLf & _
Worksheets("PopUp Messages").Range("A2").Text & vbTab & Worksheets("PopUp Messages").Range("B2").Text & vbCrLf & _
Worksheets("PopUp Messages").Range("A3").Text & vbTab & Worksheets("PopUp Messages").Range("B3").Text
MsgBox strTxt, vbOKOnly + vbInformation, "Pertinent Budget Data"
End Sub