Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Paste cells from one workbook to another
Hi all,
I'm new to VBA programming and I have what should be a simple question for you experts! Basically, I have 2 workbooks and I want to copy a range of cells from Workbook A and paste them in Workbook B. I am getting a 'subscript out of range' error when I try to pase and I cannot figure out why. Below you will find the code that I am using: Set wbDest = ActiveWorkbook Set wbSource = Workbooks.Open(cdbBrowse.Filename) wbSource.Worksheets("Sheet1").Range("A9:E13").Copy Destination:=wbDest.Worksheets("Sheet1").Range("A9 :E13") I know the problem is something with the Destination because if I just do the Copy statement with no destination, I get no error. Also, right now I have some other code in place that inserts blank lines prior to doing the paste. Is there a way that I can just insert the copied cells??? Thank you so much in advance for your help! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to copy a range of cells and paste into a new workbook in differentcolumns | Excel Discussion (Misc queries) | |||
'External links' in formulas when the user paste cells to other workbook? | Excel Programming | |||
I cannot paste from one workbook to another. Copy works, paste do. | Excel Discussion (Misc queries) | |||
Need a macro to copy a range in one workbook and paste into another workbook | Excel Programming | |||
Copy a range of cells in an unopened workbook and paste it to the current workbook | Excel Programming |