Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Copy Selection - Paste Selection - Delete Selection

Thanks. Perfect.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Selection - Transpose Selection - Delete Selection Uninvisible Excel Discussion (Misc queries) 2 October 23rd 07 04:18 PM
Help creating a macro to copy and paste a certain selection Shu of AZ Excel Discussion (Misc queries) 0 January 8th 07 04:36 AM
Need a macro to Copy a selection and paste into a new email. Koolmist Excel Discussion (Misc queries) 3 February 20th 06 04:48 PM
copy and paste multiple selection Gareth[_3_] Excel Programming 7 May 29th 05 12:23 AM
Copy&Paste and Selection Change Bura Tino Excel Programming 3 November 22nd 03 01:35 AM


All times are GMT +1. The time now is 07:16 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"