Realtreegirl75
New Member
- Joined
- Aug 28, 2022
- Messages
- 40
- Office Version
- 365
- Platform
- Windows
I'm working on creating a VBA that will save a document automatically based on information in the document. Here is the code:
Dim tdayName As String
Dim MPID As String
Dim numb As String
Dim tday As String
MPID = Range("O4").Text
numb = Range("C4").Text
tday = Range("H4").Text
tdayName = "SCP - " & MPID & " - " & numb & " - " & tday
MsgBox tdayName
Application.Dialogs(xlDialogSaveAs).Show tdayName
O4 is 123456
C4 is E.123456
H4 is 2022-10-30
The message box shows the correct name SCP - 123456 - E.123456 - 2022-10-30
The name won't come up in the save dialog box unless I remove the "." from cell C4. Is there anyway around this or will we just have to leave the period out when typing in the number in cell C4?
Dim tdayName As String
Dim MPID As String
Dim numb As String
Dim tday As String
MPID = Range("O4").Text
numb = Range("C4").Text
tday = Range("H4").Text
tdayName = "SCP - " & MPID & " - " & numb & " - " & tday
MsgBox tdayName
Application.Dialogs(xlDialogSaveAs).Show tdayName
O4 is 123456
C4 is E.123456
H4 is 2022-10-30
The message box shows the correct name SCP - 123456 - E.123456 - 2022-10-30
The name won't come up in the save dialog box unless I remove the "." from cell C4. Is there anyway around this or will we just have to leave the period out when typing in the number in cell C4?