Hi
The easies way is to have query tables. This will be the dynamic replica of the data from individual sheets
Here is an example that you can finetune for your requirement
Sub Excel_QueryTable()
Dim oCN As ADODB.Connection
Dim oRS As ADODB.Recordset
Dim ConnString As String
Dim SQL As String
Dim qt As QueryTable
ConnString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\SubFile.xls;Extended Properties=Excel 8.0;Persist Security Info=False"
Set oCN = New ADODB.Connection
oCN.ConnectionString = ConnString
oCN.Open
SQL = "Select * from [Sheet1$]"
Set oRS = New ADODB.Recordset
oRS.Source = SQL
oRS.ActiveConnection = oCN
oRS.Open
Set qt = Worksheets(1).QueryTables.Add(Connection:=oRS, _
Destination:=Range("B1"))
qt.Refresh
If oRS.State <> adStateClosed Then
oRS.Close
End If
If Not oRS Is Nothing Then Set oRS = Nothing
If Not oCN Is Nothing Then Set oCN = Nothing
End Sub
Regards
Shasur
http://www.dotnetdud.blogspot.com
VBA Tips & Tricks (
http://www.vbadud.blogspot.com)