Results 1 to 4 of 4

Copy, transpose paste, and delete rows macro

Threaded View

  1. #1
    Registered User
    Join Date
    06-23-2017
    Location
    Glasgow, UK
    MS-Off Ver
    2013
    Posts
    2

    Copy, transpose paste, and delete rows macro

    Hello!

    I copied some data (flight information) from a website to create a .txt file and opened it in Excel with tab and space delimiters. The data has imported so that it is all in the first column as a long list. My data is in blocks of 7 cells and I want to display each flight as a single row with seven columns.

    I was originally copying the seven vertical cells, and then using paste transpose to make the row next to the first cell of the block. I then delete the six rows beneath the first cell and start again with the next seven rows. I recorded a macro of this and tried to play around with it to no avail.

    I'm new to VBA so any help would be very much appreciated!

    Thanks!

    Sub Transpose()
    '
    ' Transpose Macro
    '
    '
    '
    
    Dim i As Integer
    
    For i = 27 To 52
    
        Range(Cell(i, 1), Cell(i + 7, 1)).Select
        Selection.Copy
        Range(Cell(i, 2)).Select
        Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
            False, Transpose:=True
        Rows(Cell(i + 1, 1), Cell(i + 7, 1)).Select
        Application.CutCopyMode = False
        Selection.Delete Shift:=xlUp
        
        Next i
        
    End Sub
    Last edited by johnjoepaddyfrancie; 06-24-2017 at 08:52 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel Macro - Copy & Paste (Font) problem & Delete Last Added Rows problem
    By LennartB in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-05-2015, 06:58 AM
  2. Replies: 1
    Last Post: 10-05-2014, 12:28 PM
  3. [SOLVED] Macro for copy and paste transpose
    By kmahesh in forum Excel General
    Replies: 5
    Last Post: 09-20-2014, 12:13 PM
  4. Need help with macro for copy/paste as transpose
    By vkartikv in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-15-2014, 05:54 PM
  5. [SOLVED] Copy, paste, transpose 4 cells delete and repeat
    By blarsen in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-18-2012, 01:29 AM
  6. Macro for copy & paste (transpose) from one workbook to another
    By Drmirafbi in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 06-22-2010, 12:05 AM
  7. Macro for copy paste values transpose
    By straggleyway in forum Excel General
    Replies: 0
    Last Post: 03-11-2009, 07:32 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1