+ Reply to Thread
Results 1 to 7 of 7

Values in columns to copy separately

  1. #1
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Question Values in columns to copy separately

    Hi,

    I have one Raw_test file and one Result file. This raw data file contains several different sheets. The sheet that I'm interested in (sheet 'box') has different column names with data starting at row 2. I need only data from 2 columns (column R and column S). The code should be in Result file.

    1. To copy data from column R from sheet 'box' in Raw_test file to be pasted to column 'Data' in Consignes sheet in the Result file.
    2. To copy the 'Date' column following the rows of the data accordingly, and paste it to 'Date' column in Consignes sheet.
    3. Under 'Parameter' column, for data in column R, the parameter should be Togg@ox2 (as specified in Control Panel).
    4. Repeat step 1 to 3 for column S (Raw_test file, sheet 'box'), but continue from the empty row after data from column R has been filled in (column S's parameter is Togg@n2, as specified in Control Panel).

    I have included an example of data extraction for column R & S (manually done). Can anyone help me to automate the data extraction?

    Thanks in advance for the help!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Values in columns to copy separately

    Code for macro in Result Workbook
    Please Login or Register  to view this content.
    In this line change the path of Raw_Test workbook as per your PC.

    Workbooks.Open Filename:="C:\Users\Madhushree\Downloads\Raw_test.xlsx"
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

  3. #3
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Re: Values in columns to copy separately

    Thanks for this!

    I tried to play around with your code, by adding in feature to allow user to choose the Raw_test file themselves but I got this error: 'Run-time error '9': subscript out of range'.

    Please Login or Register  to view this content.
    May I know which part that I did wrong?

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Values in columns to copy separately

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    09-19-2017
    Location
    London
    MS-Off Ver
    2015
    Posts
    169

    Re: Values in columns to copy separately

    Hi, jindon

    Thanks for this! The other users tried to use this but they kept having error "Method 'Open' of object '_Connection' failed". Tried contacting our IT team to help but they are not helping much so I was thinking to avoid using ADODB as I cannot pinpoint the issue. Is it possible to have the code some other way?

    Thank you once again!

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Values in columns to copy separately

    Then simply
    Please Login or Register  to view this content.

  7. #7
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,577

    Re: Values in columns to copy separately

    Please Login or Register  to view this content.
    This code working for me . Try this
    Please Login or Register  to view this content.
    Or Pl upload file.
    Last edited by kvsrinivasamurthy; 11-18-2020 at 05:11 AM.

+ 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. Replies: 4
    Last Post: 02-08-2020, 04:41 PM
  2. How do I separately sum negative an positive values
    By Martina Bergquist in forum Excel Charting & Pivots
    Replies: 12
    Last Post: 05-28-2016, 07:19 AM
  3. [SOLVED] Compare data in columns and return separately Part II
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-01-2015, 09:49 AM
  4. [SOLVED] Compare data in columns and return separately
    By marreco in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-16-2013, 07:36 PM
  5. Replies: 1
    Last Post: 12-20-2012, 09:24 PM
  6. Sum EURO and USD values separately.
    By contaminated in forum Excel General
    Replies: 7
    Last Post: 05-30-2009, 12:15 PM
  7. Matching Numbers 2 Columns Separately
    By MD507 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-27-2008, 01:13 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