text 如何在VBA中合并工作簿路径?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text 如何在VBA中合并工作簿路径?相关的知识,希望对你有一定的参考价值。

Sub ShowUser()

ActiveCell.Value = Environ("UserName")                                                 'returns the domain name
ActiveCell.Offset(1, 0).Value = Application.UserName                                   'the user registered name
ActiveCell.Offset(2, 0).Value = Application.UserLibraryPath                            'location where COM-Addins are installed
ActiveCell.Offset(3, 0).Value = "C:\Users\" & UCase(Environ("UserName")) & "\Desktop"  'returns a custom directory
ActiveCell.Offset(4, 0).Value = ActiveWorkbook.FullName                                'the path + the name of the file <-- assimes file has been saved
ActiveCell.Offset(5, 0).Value = ActiveWorkbook.name                                    'returns the name of the file alone
ActiveCell.Offset(6, 0).Value = ActiveWorkbook.path                                    'returns the path where it is saved
ActiveCell.Offset(7, 0).Value = Application.PathSeparator                              'returns the dash

'hp
'Angelina
'C:\Users\hp\AppData\Roaming\Microsoft\AddIns\
'C:\Users\HP\Desktop
'C:\Users\hp\Google Drive\Analytics\Blogging\Excel Spreadsheets\Get it Right in Excel Workshop.xlsb
'Get it Right in Excel Workshop.xlsb
'C:\Users\hp\Google Drive\Analytics\Blogging\Excel Spreadsheets
'\
 
End Sub

以上是关于text 如何在VBA中合并工作簿路径?的主要内容,如果未能解决你的问题,请参考以下文章