Thread: Writing a macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default 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" wrote in message
...

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