+ Reply to Thread
Results 1 to 3 of 3

Copy and Paste technique, referencing variables within cells

  1. #1
    Registered User
    Join Date
    10-29-2013
    Location
    Sydney, Australiia
    MS-Off Ver
    Excel 2007/2010
    Posts
    2

    Post Copy and Paste technique, referencing variables within cells

    I currently receive a number of reports, that are preformated in XLSX format from a separate reporting tool. These form our source of truth, of which I've developed a number of audit templates to provide exceptions reporting.

    The only area I'm currently struggling with, is automating the collection of the input data. That is, automatically bringing the above-mentioned Excel data into my spreadsheets.

    I'll explain the process for input, and look forward to some feedback from the guru's within the forum:


    1. Open a file based upon worksheet showing Variables
    1a. Source UNC Path = (e.g. \\SERVER\Path\)
    1b. Source File Name = (e.g. FILENAME.xlsx)
    1c. Source Worksheet = (e.g. Sheet1
    1d. Source Cell = (e.g. A8)
    1e. Destination Worksheet = (e.g. "RAW DATA - CMDB")
    1f. Destination Cell = M2

    2. Based upon steps 1a to 1d, select the entire range of data from A8.
    NOTE: I have found some code which works quite fine for this.
    For the purposes of this example, let's say cells A8-C10

    3. Based upon steps 1e to 1f, paste the copied data

    4. Repeat steps 2 to 3, for all entries within the table within Step 1.


    I've spent quite some time investigating such a solution, to no evail. Your assistance would be extremely appreciated.

  2. #2
    Forum Contributor
    Join Date
    04-25-2013
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2010
    Posts
    150

    Re: Copy and Paste technique, referencing variables within cells

    Is it just the pasting that you are having trouble with? Which cells will you be copying, and to where will you be pasting them, when you repeat the process?

  3. #3
    Registered User
    Join Date
    10-29-2013
    Location
    Sydney, Australiia
    MS-Off Ver
    Excel 2007/2010
    Posts
    2

    Re: Copy and Paste technique, referencing variables within cells

    Quote Originally Posted by djdjdj View Post
    Is it just the pasting that you are having trouble with? Which cells will you be copying, and to where will you be pasting them, when you repeat the process?
    Thanks for asking djdjdj,

    YYYY-MM-DD Copy Paste from Cell Values_v0.21.xlsx
    5516.xlsx
    ALL-TADDMInventory.xlsx

    I guess I'm struggling in most of the points. Putting the whole copy and paste into VBA that loops.

    I've mocked up a set of 3 files (and attached) as a basic example of the Template (YYYY-MM...xlsx) and the source data files (5516.xlsx and All-TADDM....xlsx).

    * YYYY-MM-DD Copy Paste from Cell Values_v0.21.xlsx -->
    The basic setup of the template file is that I have
    - "Raw Data..." worksheets which will contain some formulas to the left (yellow highlighted fields) and the destination for the source data files to the right (blue highlighted fields); and
    - "Variables" worksheet containing all the attributes I've described in my original post. Below, I've also added the actual content contained in this worksheet as attached:

    Source UNC Path: \\media-pc\N\Temp\ , \\media-pc\N\Temp\
    Source File Name: 5516.xlsx , ALL-TADDMInventory.xlsx
    Source Worksheet: CI Details_4 , Data
    Source Cell: A8 , A2
    Destination Worksheet: Raw Data - CMDB Dump , Raw Data - TADDM Dump
    Destination Cell: K2 , H2


    Hopefully this makes sense, and I look forward to your guidance.

+ 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. [SOLVED] Assigning/Applying Variables to Copy/Paste Columns
    By Gard5096 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-07-2012, 11:59 AM
  2. Copy-Paste sheet from other Files with different variables
    By Timal03 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-02-2012, 10:20 PM
  3. copy and paste without referencing original sheet
    By tinkerist in forum Excel General
    Replies: 3
    Last Post: 04-07-2012, 08:26 PM
  4. Copy and paste variables using a macro
    By Nigel in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 06-11-2008, 11:13 PM
  5. speed - variables vs copy paste
    By carsto in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-03-2008, 03:34 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