hi MD Sir
i am learning VB so sorry for silly question. but can i do some this like because there will be deference nos of sheets in WB1 and WB2 to copy
Dim ii As Integer
Dim WB1 As Workbook
Dim WB2 As Workbook
Dim WBDest As Workbook
Dim i As Long
Dim n As Long
Set WBDest = Workbooks("destination.xls")
'Find the next empty row to copy the data to WBDest'
Set Rng = WBDest.Range("A2")
Set RngEnd = WBDest.Cells(Rows.Count, Rng.Column).End(xlUp)
NextRow = IIf(RngEnd.Row < Rng.Row, Rng.Row, RngEnd.Row + 1)
'Open up your first workbook, copy data
Set WB1 = Workbooks.Open("C:\Documents and Settings\Srusty\My Documents\NoShow\book1.xls")
For i = 1 To WB1.Sheets.Count
WB1.Sheets(i).Range("A12:G12").Copy
WBDest.Sheets("Sheet1").Cells(2, 1).Insert shift:=xlShiftDown
With WBDest
.Cells(NextRow, "A").Resize(1, 10) = WB1.Sheets(i).Cells(n, "A").Resize(1, 10).Value
End With
Next
'Close first workbook
WB1.Close savechanges:=False
i did Use the macro recorder but it give long codes like here for every sheet
Sheets("Sheet1").Select
Range("A12:G12").Select
Selection.Copy
Windows("destination.xls").Activate
Sheets("Sheet1").Select
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("Book1.xls").Activate
Sheets("Sheet2").Select
Range("A12:G12").Select
Application.CutCopyMode = False
Selection.Copy
Windows("destination.xls").Activate
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=False
so pl help to reduce the code