Hi,
If the workbook does not need to stay closed, this would work (modify for path, workbook name, and ThisWorkbook sheet name):
Code:
Sub Test1()
Workbooks.Open Filename:="C:\Your\File\Path\Book1.xlsx"
Dim ws As Worksheet
Dim i As Integer
With ThisWorkbook.Worksheets("Sheet1")
.Range("A:A").ClearContents
For Each ws In ActiveWorkbook.Worksheets
i = i + 1
.Range("A" & i) = ws.Name
Next ws
End With
Workbooks("Book1").Close False
End Sub
I am getting out of range error @ "Workbooks("Book1").CloseFalse"
I dont want to clear the text from A column. Whatever text is in column A should be remain intact, only need to add same data after last row. If any new name sheet added with new name in Book1. Then it should also included.
I dont want to clear the text from A column. Whatever text is in column A should be remain intact, only need to add same data after last row. If any new name sheet added with new name in Book1. Then it should also included.