Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Selection - Paste Selection - Delete Selection
I am trying to develop a macro which will allow me to copy a vertical
selection, paste special transpose it horizontally and then want to delete (shift cells up) the vertical selection I copied. Any thoughts on how to put this together? I am trying to develop one macro as I need to copy and transpose several hundere records. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Selection - Paste Selection - Delete Selection
The code below should help. I assumed the first cell doesn't change. the
cells beneath the active cell gets moved to the right of the active cell. I also assumed all the cells until the first blank cell will get moved. The xlDown get all the cells until the first empty cell. Sub remove() Set firstcell = ActiveCell firstcell.Offset(1, 0).Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy firstcell.Offset(0, 1).Select Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _ False, Transpose:=True firstcell.Offset(1, 0).Select Range(Selection, Selection.End(xlDown)).Delete Shift:=xlUp End Sub "Uninvisible" wrote: I am trying to develop a macro which will allow me to copy a vertical selection, paste special transpose it horizontally and then want to delete (shift cells up) the vertical selection I copied. Any thoughts on how to put this together? I am trying to develop one macro as I need to copy and transpose several hundere records. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy Selection - Paste Selection - Delete Selection
Thanks. Perfect.
|
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy Selection - Transpose Selection - Delete Selection | Excel Discussion (Misc queries) | |||
Help creating a macro to copy and paste a certain selection | Excel Discussion (Misc queries) | |||
Need a macro to Copy a selection and paste into a new email. | Excel Discussion (Misc queries) | |||
copy and paste multiple selection | Excel Programming | |||
Copy&Paste and Selection Change | Excel Programming |