dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,375
- Office Version
- 365
- 2016
- Platform
- Windows
Is it possible to have a line break in a message box or increase the font size of some of the text? I have this vba and I want to emphasize the Without saving them part.
VBA Code:
Sub Workbook_Open()
'lastrow = sht.ListObjects("Table1").Range.Rows.Count
'Worksheets("home").Unprotect Password:="costings"
Application.WindowState = xlMaximized
Dim file1 As Integer
Dim strLine As String
file1 = FreeFile
If Not ActiveWorkbook.ReadOnly = True Then
'only add name to the usage log if the user has it locked
Open ThisWorkbook.Path & "\usage.log" For Append As #file1
Print #file1, Environ("USERNAME") & ". Please close all the additional workbooks that will be opened " _
& "without saving them. Then contact the user that has it open or wait until they are finished."
Close #file1
Else
'if someone else has the file open, find out who
Open ThisWorkbook.Path & "\usage.log" For Input Access Read As #file1
Do While Not EOF(file1)
Line Input #file1, strLine
Loop
Close #file1
MsgBox "The following user has the allocation sheets open: " & strLine
End If
'Sheets("home").Shapes("txtName").TextFrame.Characters.Text = "Type sheet name here."
'Worksheets("home").txtDirectCombo.Value = Worksheets("home").txtDirectMonth.Value & " " & Worksheets("home").txtDirectYear.Value
'Worksheets("home").Protect Password:="costings"
End Sub
Last edited: