Home > Software engineering >  The application or object error
The application or object error

Time:11-20

Sub merger (2)
Dim fn $, rng1 As Range, rng2 As Range, n %
Range (" a6: ac1000 "). ClearContents
Fn=Dir (ThisWorkbook Path & amp; "\ *. XLSX")
Do
N=n + 1
Workbooks. Open (ThisWorkbook. Path & amp; "" & amp; Fn)
The Set rng1=ActiveWorkbook. Sheets (1). The Range (" a6, "[ac6]. End (xlDown))
this errorSet rng2=ThisWorkbook. Sheets (the "merger") Cells (Rows) Count, 1). The End (xlUp) (2, 1)
Rng1. Copy rng2
ActiveWorkbook. Close 0
Loop Until fn=""
End Sub

The above code in the application or object error!!!!! What's the cause of the

CodePudding user response:

[ac6]. End (xlDown) into the range (" ac6) End (xlDown) try
  •  Tags:  
  • VBA
  • Related