Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default insert table into specific location

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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default insert table into specific location

On Nov 25, 9:43*pm, Dave Peterson wrote:
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- Hide quoted text -

- Show quoted text -


Fantastic... thanks heaps......
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert new Worksheet with name, and insert the sheet into itsalphabetical / numerical location S Davis Excel Programming 0 May 12th 08 07:13 PM
Always print to a specific location Tommy-B[_2_] Excel Discussion (Misc queries) 0 June 15th 07 06:29 PM
Saving to a specific location Sandy Excel Programming 9 June 9th 07 05:57 PM
Save to specific location LB79 Excel Discussion (Misc queries) 2 August 25th 05 11:02 AM
Need help in calculation at specific location Lewis Koh Excel Worksheet Functions 10 July 31st 05 04:35 PM


All times are GMT +1. The time now is 03:30 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"