+ Reply to Thread
Results 1 to 7 of 7

can some one delete the header from this COde

  1. #1
    Registered User
    Join Date
    12-09-2015
    Location
    india
    MS-Off Ver
    2007
    Posts
    22

    Arrow can some one delete the header from this COde

    This code is for spliting of data from a sheet to another sheets based upon a column but it is taking first Row as header and repeated in all sheets so kindly tell which lin i have to delete from this code



    Sub parse_data()
    Dim lr As Long
    Dim ws As Worksheet
    Dim vcol, i As Integer
    Dim icol As Long
    Dim myarr As Variant
    Dim title As String
    Dim titlerow As Integer
    vcol = 1
    Set ws = Sheets("Sheet1")
    lr = ws.Cells(ws.Rows.Count, vcol).End(xlUp).Row
    title = "A1:C1"
    titlerow = ws.Range(title).Cells(1).Row
    icol = ws.Columns.Count
    ws.Cells(1, icol) = "Unique"
    For i = 2 To lr
    On Error Resume Next
    If ws.Cells(i, vcol) <> "" And Application.WorksheetFunction.Match(ws.Cells(i, vcol), ws.Columns(icol), 0) = 0 Then
    ws.Cells(ws.Rows.Count, icol).End(xlUp).Offset(1) = ws.Cells(i, vcol)
    End If
    Next
    myarr = Application.WorksheetFunction.Transpose(ws.Columns(icol).SpecialCells(xlCellTypeConstants))
    ws.Columns(icol).Clear
    For i = 2 To UBound(myarr)
    ws.Range(title).AutoFilter field:=vcol, Criteria1:=myarr(i) & ""
    If Not Evaluate("=ISREF('" & myarr(i) & "'!A1)") Then
    Sheets.Add(after:=Worksheets(Worksheets.Count)).Name = myarr(i) & ""
    Else
    Sheets(myarr(i) & "").Move after:=Worksheets(Worksheets.Count)
    End If
    ws.Range("A" & titlerow & ":A" & lr).EntireRow.Copy Sheets(myarr(i) & "").Range("A1")
    Sheets(myarr(i) & "").Columns.AutoFit
    Next
    ws.AutoFilterMode = False
    ws.Activate
    End Sub
    Last edited by sai0449; 12-09-2015 at 12:11 PM. Reason: solved

  2. #2
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: can some one delete the header from this COde

    I think it would be these 2 lines
    Please Login or Register  to view this content.
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: can some one delete the header from this COde

    Please wrap your code with code tags as per forum's rule

    CHANGE
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    12-09-2015
    Location
    india
    MS-Off Ver
    2007
    Posts
    22

    Re: can some one delete the header from this COde

    Nope i am not getting data if i delete that only empty sheets i am geetting please check

  5. #5
    Forum Expert
    Join Date
    07-31-2010
    Location
    California
    MS-Off Ver
    Excel 2007
    Posts
    4,070

    Re: can some one delete the header from this COde

    AB33 is right. Either that or change this line

    Please Login or Register  to view this content.
    If you are happy with my response please click the * in the lower left of my post.

  6. #6
    Registered User
    Join Date
    12-09-2015
    Location
    india
    MS-Off Ver
    2007
    Posts
    22

    Re: can some one delete the header from this COde

    Thank you so much

  7. #7
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: can some one delete the header from this COde

    Dang it, how did I miss that?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 1
    Last Post: 11-10-2014, 05:48 PM
  2. [SOLVED] Delete Column only after certain Row with Specified Header
    By Pho6 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-16-2013, 02:36 PM
  3. Delete column based on header row value
    By dagindi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-31-2011, 02:30 PM
  4. Delete column based on header row value
    By Spider_dude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-14-2009, 03:01 PM
  5. how to delete header on second page of spreadsheet
    By rcarr_6 in forum Excel General
    Replies: 1
    Last Post: 05-04-2006, 09:40 AM
  6. How do I delete a header?
    By Amber in forum Excel General
    Replies: 2
    Last Post: 02-20-2006, 10:40 AM
  7. how do you delete a header in Page Setup?
    By sdf in forum Excel General
    Replies: 2
    Last Post: 04-19-2005, 05:06 PM

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