+ Reply to Thread
Results 1 to 2 of 2

row deletion

Hybrid View

  1. #1
    Registered User
    Join Date
    01-18-2013
    Location
    london
    MS-Off Ver
    Excel 2003
    Posts
    1

    row deletion

    Hi guys,

    I have this excel extract a huge document. I need to either delete the date or move everything to one line so that its in this order Date Name Text. Is there any way I can do this easly?

    Name
    Date
    Text

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: row deletion

    Hi, jusciusr,

    if all your data is in Column A and starts with Row 1 and each item is only one cell (no blanks) you could use a formula as well as VBA-Code:
    Sub ReWriteData()
    Dim lngLast As Long
    Dim lngCounter As Long
    Dim lngTarg As Long
    Dim lngCol As Long
    
    Const cstrCol As String = "A"
    Const clngTarg As Long = 4
    
    lngLast = Cells(Rows.Count, cstrCol).End(xlUp).Row
    lngTarg = 1
    lngCol = clngTarg
    
    For lngCounter = 1 To lngLast
      lngCol = lngCol + 1
      Cells(lngTarg, lngCol).Value = Cells(lngCounter, cstrCol)
      If lngCounter Mod 3 = 0 Then
        lngCol = clngTarg
        lngTarg = lngTarg + 1
      End If
    Next lngCounter
    End Sub
    This code will write the data starting at Column E. Please test the code on a copy of the original workbook.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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