View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default merging worksheets

Sub MergeTwoWorksheets()
Dim sh1 As Worksheet, sh2 As Worksheet
Dim sh3 As Worksheet, rng1 As Range
Dim rng2 As Range
Set sh1 = Worksheets(1)
Set sh2 = Worksheets(2)
Set sh3 = Worksheets.Add(after:=Worksheets(Worksheets.Count) )
Set rng1 = sh1.Range("A1").CurrentRegion
Set rng2 = sh2.Range("A1").CurrentRegion
Set rng2 = rng2.Offset(1,0).Resize(rng.rows.count-1)
rng1.Copy sh3.Range("A1")
rng2.Copy sh3.Range("A1").Offset( _
rng1.Rows.Count, 0)
End Sub

--
Regards,
Tom Ogilvy


wrote in message
ups.com...
Thanks a lot! It works very well and I don't have to keep deleting the
"master" sheet! Now that I have this, any ideas how to get rid of the
header on the top of the second sheet (for example, where in the above
code would I make the modifications for this to happen)?

~M