bh9aq
06-21-2006, 08:10 AM
Hello,
I'm working with two seperate workbooks in Excel 2000, The main workbook where My Macro is, is a data collection spreadsheet looking up some values from the second workbook. There is a unique code in one of the cells of the main workbook which looks up the values. I want the macro to run through the list on 2nd workbook looking up the unique code and updatting the main workbook and each time saving the file as it goes along. I've got the code for it to save but I need it to run through the list automatically.
The code is as follows:
Public Sub SaveAs()
Const PATH As String = "O:\P&r\Resource\Statistics\"
With ThisWorkbook
.SaveAs Filename:=PATH & _
.Sheets("Key Stage 2").Range("B4").Value & ".xls"
End With
End Sub
Please could someone help as I don't even know the basics of Visual Basic!
Many Thanks
Homara
I'm working with two seperate workbooks in Excel 2000, The main workbook where My Macro is, is a data collection spreadsheet looking up some values from the second workbook. There is a unique code in one of the cells of the main workbook which looks up the values. I want the macro to run through the list on 2nd workbook looking up the unique code and updatting the main workbook and each time saving the file as it goes along. I've got the code for it to save but I need it to run through the list automatically.
The code is as follows:
Public Sub SaveAs()
Const PATH As String = "O:\P&r\Resource\Statistics\"
With ThisWorkbook
.SaveAs Filename:=PATH & _
.Sheets("Key Stage 2").Range("B4").Value & ".xls"
End With
End Sub
Please could someone help as I don't even know the basics of Visual Basic!
Many Thanks
Homara