+ Reply to Thread
Results 1 to 3 of 3

Copy range of column into new column

  1. #1
    Registered User
    Join Date
    11-10-2011
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Copy range of column into new column

    Please help!
    I want use a vba script or macro to copy a range of celsl from one column into another column. Thus, these columns do not have the same size

    Situation:
    I download on a daily basis end-of-day data from various markets into two columns (date, price). I download a fixed period of time, 15 years. But because the number of trading days vary, i get a column with variable length.
    To assure that all my calculations in other worksheets are executed in the right way, I need a FIXED amount of data. Therefore I download more calendar days then I actually need and then I need to copy a fixed number of cells (3850) into a another column. This range has to end with the last available date and must include the previous 3850 cells.

    How can I make this work?
    Any help would be much appreciated. Thanks

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Copy range of column into new column

    Hi
    If I read you rightly you want to use an offset formula linking the data in your calculations columns to the data in the columns into which you paste the data. So if there are say 4000 used cells in the pasted data you want to offset the start of your calculated range by 150 to ensure the last observation is in cell 3850.

    If so, assuming your pasted data are in columns 1 and 2 of sheet 1, try the following formula for columns 1 and 2 of your adjusted data:

    Column 1:
    Please Login or Register  to view this content.
    Column 2:
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    11-10-2011
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    2

    Smile Re: Copy range of column into new column

    @NickyC

    Thank you so much! This worked perfect for me. Just had to translate everyting in Dutch, and then it worked! completed it with an IF .. THEN ELSE to leave out the 0 fields. So just for the Dutch it looks like this ;-)

    =ALS(VERSCHUIVING(Data!B3;AANTALARG(Data!B:B)-3850;0)=0;"";VERSCHUIVING(Data!B3;AANTALARG(Data!B:B)-3850;0))

    Once again, Thanks a lot

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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