+ Reply to Thread
Results 1 to 2 of 2

Automating paste linking

  1. #1
    Registered User
    Join Date
    01-30-2014
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    1

    Automating paste linking

    Hi folks,

    I'm new to the forum and this my first post. I have very basic knowledge of VBA (basically nothing).

    I'm in a bit of a pickle. This is what I have to do: Workbook A has 50+ worksheets with unique names (non-numerical and non-consecutive) with data in range A1:C30. I need to link the data range from Workbook A to the same place (A1:C30) in Workbook B for sheets. So WorkbookA, Sheet1, A1:C30 will be linked to WorkbookB,Sheet1,A1:C30, WorkbookA, Sheet2, A1:C30 will be linked to WorkbookB,Sheet2,A1:C30, WorkbookA, Sheet3, A1:C30 will be linked to WorkbookB,Sheet3,A1:C30... etc

    I've just made the workbook name and sheet names up above. The workbooks have different names, but the sheets within both workbooks have the same name. The range (A1:C30) need to stay the same because that data feeds in to chart. I'm using Excel 2010.

    I've recorded a macro for the first few slides but don't to manually copy and paste link. Here's what I have:

    Windows("WorkbookA.xlsx").Activate
    Sheets("Sheet1").Select
    Range("A1:C29").Select
    Range("C29").Activate
    Application.CutCopyMode = False
    Selection.Copy

    Windows("WorkbookB.xlsx").Activate
    Sheets("Sheet1").Select
    Range("A1").Select
    ActiveSheet.Paste Link:=True

    I was thinking of using For Each... Next... Until... but I lack the knowledge to turn that in to a working code.

    Hoping for a swift repose. Many thanks in advance!
    Ab

  2. #2
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,784

    Re: Automating paste linking

    Based on you recorded code perhaps something like this?

    Please Login or Register  to view this content.
    As macro is added to the "WorkbookB" this will now be a xlsm file

    Alf

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. automating copy paste to sheets
    By ecivon in forum Excel - New Users/Basics
    Replies: 0
    Last Post: 09-26-2012, 04:58 AM
  2. Automating paste-block formatting
    By sandozlove in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-05-2010, 05:55 PM
  3. Automating repeated copy/paste
    By samab in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-24-2009, 03:26 AM
  4. automating cut and paste?
    By LiamF in forum Excel General
    Replies: 9
    Last Post: 03-16-2007, 07:20 AM
  5. [SOLVED] automating copy and paste
    By Anne in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-04-2005, 08:06 PM

Tags for this Thread

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