+ Reply to Thread
Results 1 to 5 of 5

copy forecast months data in a year period (variable range)

  1. #1
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    copy forecast months data in a year period (variable range)

    Hi All,

    Basically i have 12 month columns A:L (Jan - Dec) in row 2
    Row 1 i have if the months are "actual" or "forecast" months
    i.e. for current year Jan - Oct would be actual months and Nov & Dec would be forecast months.

    I'd like to copy all data from row 3 down for the forecast months only.

    I've got below code which copies all months but would like to tailor it for above.

    Please Login or Register  to view this content.
    Last edited by Gti182; 10-23-2014 at 06:54 AM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: copy forecast months data in a year period (variable range)

    hi Gti182, option

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    Re: copy forecast months data in a year period (variable range)

    that works really well Watersev, only issue is i would like to paste the forecast columns into the same columns in sheet 2, code above pastes it into column A

  4. #4
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    Re: copy forecast months data in a year period (variable range)

    this is my actual code. The red highlighted part is what i'm struggling with, any help?

    [code]
    Set ds = Sheets("Data Sheet")
    Set du = Sheets("Data Uploader")

    LastRow = ds.Range("B" & Rows.Count).End(xlUp).Row

    ds.Range(ds.Range("A5:S5").Find("Forecast", , xlValues, xlWhole).Offset(2), ds.Cells(LastRow, 19)).Copy

    du.Range("Column?:Row14").PasteSpecial xlPasteValues

    Application.CutCopyMode = 0

  5. #5
    Forum Contributor
    Join Date
    10-04-2010
    Location
    London
    MS-Off Ver
    Office 365
    Posts
    455

    Re: copy forecast months data in a year period (variable range)

    managed to get this code to work

    [code]
    Set ds = Sheets("Data Sheet")
    Set du = Sheets("Data Uploader")

    LastRow = ds.Range("B" & Rows.Count).End(xlUp).Row

    cn = ds.Range("A5:S5").Find("Forecast", , xlValues, xlWhole).Column - 1

    ds.Range(ds.Range("A7").Offset(0, cn), ds.Cells(LastRow, 19)).Copy

    du.Range("A14").Offset(0, cn).PasteSpecial xlPasteValues

    [code]

+ 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: 0
    Last Post: 04-13-2012, 03:10 AM
  2. Replies: 2
    Last Post: 08-06-2011, 11:15 AM
  3. Replies: 3
    Last Post: 02-22-2010, 07:29 AM
  4. Create a Forecast table with dynamical period range
    By dreams in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-17-2009, 08:48 AM
  5. Replies: 3
    Last Post: 03-12-2009, 09:54 AM

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