View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default insert table into specific location

Option Explicit
Sub testme()

Dim RngToCopy As Range
Dim DestCell As Range

Set RngToCopy = Workbooks("Personal.xls").Worksheets("somesheetnam ehere") _
.Range("table.to.insert")

Set DestCell = ActiveSheet.Range("B24")

With DestCell
.Parent.Unprotect
RngToCopy.Copy _
Destination:=.Cells
.Parent.Protect
End With

End Sub


Forgone wrote:

I need a point in the right direction.

I've got a series of workbooks that I need to paste a specific table
into on an activesheet. The table is located in the personal.xls file
which I've given it a name (let's call it..... table.to.insert)

All I want to achieve is with the activesheet I'm on. unprotect the
sheet, copy (table.to.insert) and paste it the active sheet in the
range B24.

I tried recording a macro and manipulate it but I couldn't get it to
copy from the personal.xls file into another worksheet. I've even
tried having the table in a seperate worksheet (closed) but that
didn't work out as planned either.

Trying to simplify it.

Source: table.to.insert (can be located anywhere, doesn't have to be
personal.xls)
Target: activesheet | range B24

Copy from source, go to activesheet, unprotect, paste and retain
everything.


--

Dave Peterson