Hello,
I need to create a macro to consolidate data from several worksheets onto one.
Here's part of my VBA code that I copy the rows from an opened
worksheet-A.xls ,and paste onto Book1.xls . However, it is very inconvenient
as to open all the worksheets every time to proceed the consolidation (i.e.
from 10 into 1) , in order to avoid any debugging message pop up. Can I run
the macro without opening the all the source data wksht? Possibly place the
file directory in the code i.o. using - * Windows("A.xls").Activate * ?
E.g. VBA
Windows("A.xls").Activate
NoOfRowFile1 = 2
'Get the total rows of this sheet
Do While Cells(NoOfRowFile1, 1) < ""
NoOfRowFile1 = NoOfRowFile1 + 1
Loop
' Include the header
NoOfRowFile1 = NoOfRowFile1
If NoOfRowFile1 1 Then
'Cells(2,1) = A2
Range(Cells(1, 1), Cells(NoOfRowFile1, 10)).Select
Selection.Copy
Windows("Book1.xls").Activate
Range("A1").Select
ActiveSheet.Paste
End If
Thx ever so much!!
kalz
"Frank Kabel" wrote:
Hi
as a starting point:
http://www.rondebruin.nl/copy2.htm
"kalz" wrote:
Hello,
I'd like to set a macro which helps to copy and paste rows of data from
several wksheets into one consolidated worksheet. As this needs to be done in
regular interval and the rows of data in the original files can vary from
time to time. I do not know how to perfectly and automatically do such
consolidation using macro.
Pls help,
thx