Urgetnt Help !!!! error : Subscript out of range error

adr12345

Board Regular
Joined
Jan 19, 2015
Messages
67
Hi
I am working on huge data file.
I am applying just three filters and copy pasting that data into different workbook.

after filtering I have :

Range("A1").Select
Selection.CurrentRegion.Select
Selection.CopySet wkbOpen = Workbooks.Open(Filename:="path\Output.xlsb")
Worksheets("Sheet1").Select


and this is where I get the error Subscript out of range error
 

Some videos you may like

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

BarryL

Well-known Member
Joined
Jan 20, 2014
Messages
1,421
is this the line you are erroring on?

Code:
 Set wkbOpen = Workbooks.Open(Filename:="path\Output.xlsb")

are you tring to open a new workbook, paste the data in and save it?
 

adr12345

Board Regular
Joined
Jan 19, 2015
Messages
67
is this the line you are erroring on?

Code:
 Set wkbOpen = Workbooks.Open(Filename:="path\Output.xlsb")

are you tring to open a new workbook, paste the data in and save it?




And i got another error "pastecpecial method of range class failed"

:(



Actually I am getting error while pasting that data . Code for it is


ActiveCell.PasteSpecial xlPasteValues
 
Last edited:

adr12345

Board Regular
Joined
Jan 19, 2015
Messages
67
I am modified the code and solving it step by stpe. everytime I am getting new errors....

Uptill applying filters, all works fine. after that i tried something like this..
Current code is ;

Range("A1").Cells.SpecialCells(xlCellTypeVisible).CopySet wkbOpen = Workbooks.Open(Filename:="path\Output.xlsb")
Workbooks("Output").Worksheets("Sheet1").Range("A1").Select
ActiveCell.PasteSpecial xlPasteAll


Now I am getting stuck at the line highlighted in bold. error is not enough system resources to display completely
 

BarryL

Well-known Member
Joined
Jan 20, 2014
Messages
1,421
would taking out the active cell not work?

Code:
Workbooks("Output").Worksheets("Sheet1").Range("A1").PasteSpecial
 

Watch MrExcel Video

Forum statistics

Threads
1,108,684
Messages
5,524,272
Members
409,567
Latest member
Shadh

This Week's Hot Topics

Top