I have this code in a Workbook called "MASTER" (which opens multiple workbooks from a given directory).
Sub AllWBooks()
Dim sName As String, wb As Workbook
ChDir "C:\Data"
sName = Dir("C:\Data\*.xls")
Do While sName <> ""
Workbooks.Open Filename:=sName
Set wb = ActiveWorkbook
sName = Dir()
Loop
End Sub
The code then opens each workbook in the Data directory in turn.
What i need to do, but am unsure of how to, is (in every opened workbook):
a) Delete rows 1,2 & 3
b) Delete columns B - BA
c) Call a subroutine named "UnmergeAllCells" to do a Cells.Unmerge on all cells in the worksheets.
d) Call a subroutine named "DeleteEmptyRows" to delete empty rows in column A.
e) Call a subroutine named "TruncateLeftString" to restrict column A to 24 characters.
Then i want to copy all cells in column A (with data in them) to a worksheet "Sheet1" iin the "MASTER" workbook. Each workbooks A column data needs to be added to the end of the last copied cells in the A column.
Many thanks for any help given.
Sub AllWBooks()
Dim sName As String, wb As Workbook
ChDir "C:\Data"
sName = Dir("C:\Data\*.xls")
Do While sName <> ""
Workbooks.Open Filename:=sName
Set wb = ActiveWorkbook
sName = Dir()
Loop
End Sub
The code then opens each workbook in the Data directory in turn.
What i need to do, but am unsure of how to, is (in every opened workbook):
a) Delete rows 1,2 & 3
b) Delete columns B - BA
c) Call a subroutine named "UnmergeAllCells" to do a Cells.Unmerge on all cells in the worksheets.
d) Call a subroutine named "DeleteEmptyRows" to delete empty rows in column A.
e) Call a subroutine named "TruncateLeftString" to restrict column A to 24 characters.
Then i want to copy all cells in column A (with data in them) to a worksheet "Sheet1" iin the "MASTER" workbook. Each workbooks A column data needs to be added to the end of the last copied cells in the A column.
Many thanks for any help given.