+ Reply to Thread
Results 1 to 2 of 2

Writing a macro

Hybrid View

  1. #1
    Registered User
    Join Date
    01-10-2006
    Posts
    17

    Writing a macro

    I have one excel sheet which is exported from some other programme. There are several blocks in it. Each block is seperated by one or two blank rows. I want to seperate these blocks in different excel tabs. How can I do that? Can anyone helpme for this?

  2. #2
    Bernie Deitrick
    Guest

    Re: Writing a macro

    Sylvia,

    Select your sheet, and run the macro below.

    HTH,
    Bernie
    MS Excel MVP


    Sub Macro1()
    Dim myArea As Range
    Dim Counter As Integer

    Counter = 0

    For Each myArea In Cells.SpecialCells(xlCellTypeConstants, 23).Areas
    Counter = Counter + 1
    Worksheets.Add.Name = "Area " & Counter
    myArea.Copy Range("A1")
    Next myArea

    End Sub


    "Sylvia" <Sylvia.21f2by_1136892601.7962@excelforum-nospam.com> wrote in message
    news:Sylvia.21f2by_1136892601.7962@excelforum-nospam.com...
    >
    > I have one excel sheet which is exported from some other programme.
    > There are several blocks in it. Each block is seperated by one or two
    > blank rows. I want to seperate these blocks in different excel tabs.
    > How can I do that? Can anyone helpme for this?
    >
    >
    > --
    > Sylvia
    > ------------------------------------------------------------------------
    > Sylvia's Profile: http://www.excelforum.com/member.php...o&userid=30300
    > View this thread: http://www.excelforum.com/showthread...hreadid=499679
    >




+ 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