Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying cells to another worksheet
Thought this would be simple - its not been today.
I have a workbook with several worksheets and need VBA code to copy the contents of worksheet "A" to worksheet "B". Both worksheets "A" and "B" exist before the macros are executed. Every attempt today has left worksheet B unchanged (essentially empty except for 4 initial header rows which existed before the attempt at copying) or has created, then opened another workBook and copied the contents to worksheet "B" in the new workbook. Suggestions ? cheers Derrick |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copying cells to another worksheet
Derrick,
Sorry but please ignore my earlier reply as it will not work in all cases. So you are better off using the following: Worksheets("A").Range(Worksheets("A").Range("A1"), Worksheets("A").Cells.SpecialCells(xlCellTypeLastC ell)).Copy Worksheets("B").Range("A1") Note that there is a space character only after Copy and the entire command should be in one line.(Unless you use the line continuation character.) Alok "Derrick Salmon" wrote: Thought this would be simple - its not been today. I have a workbook with several worksheets and need VBA code to copy the contents of worksheet "A" to worksheet "B". Both worksheets "A" and "B" exist before the macros are executed. Every attempt today has left worksheet B unchanged (essentially empty except for 4 initial header rows which existed before the attempt at copying) or has created, then opened another workBook and copied the contents to worksheet "B" in the new workbook. Suggestions ? cheers Derrick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copying Cells to new row on different worksheet | Excel Worksheet Functions | |||
Copying worksheet cells into another worksheet using autofill | Excel Discussion (Misc queries) | |||
copying cells to another worksheet | Excel Worksheet Functions | |||
Copying a worksheet witrh protected cells to a new worksheet | Excel Worksheet Functions | |||
Copying cells from 1 worksheet to another | New Users to Excel |