Sub nhnn()
Dim str As String
str = Replace(ThisWorkbook.FullName, ThisWorkbook.Name, "")
str = Left(str, InStrRev(Left(str, Len(str) - 1), "\"))
ActiveSheet.Range("A1").Value = str
End Sub
Bài đã được tự động gộp:
Code khác cũng hay, dùng object có Function getparent:
Mã:
Sub nhnn1986()
Dim fso As Object
Dim str As String
Set fso = CreateObject("Scripting.FileSystemObject")
str = fso.GetParentFolderName(ThisWorkbook.Path)
ActiveSheet.Range("A1").Value = str
End Sub
Bài đã được tự động gộp:
Code khác cũng hay, dùng object có Function getparent:
Mã:
Sub nhnn1986()
Dim fso As Object
Dim str As String
Set fso = CreateObject("Scripting.FileSystemObject")
str = fso.GetParentFolderName(ThisWorkbook.Path)
ActiveSheet.Range("A1").Value = str
End Sub
Sub nhnn()
Dim str As String
str = Replace(ThisWorkbook.FullName, ThisWorkbook.Name, "")
str = Left(str, InStrRev(Left(str, Len(str) - 1), "\"))
ActiveSheet.Range("A1").Value = str
End Sub
Bài đã được tự động gộp:
Code khác cũng hay, dùng object có Function getparent:
Mã:
Sub nhnn1986()
Dim fso As Object
Dim str As String
Set fso = CreateObject("Scripting.FileSystemObject")
str = fso.GetParentFolderName(ThisWorkbook.Path)
ActiveSheet.Range("A1").Value = str
End Sub
Bài đã được tự động gộp:
Code khác cũng hay, dùng object có Function getparent:
Mã:
Sub nhnn1986()
Dim fso As Object
Dim str As String
Set fso = CreateObject("Scripting.FileSystemObject")
str = fso.GetParentFolderName(ThisWorkbook.Path)
ActiveSheet.Range("A1").Value = str
End Sub