+ Reply to Thread
Results 1 to 6 of 6

Need help on offset and copy coding using VBA

  1. #1
    Registered User
    Join Date
    12-30-2013
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Need help on offset and copy coding using VBA

    Hi there,

    I am looking for some help with a forecasting model.

    In order to update the model I need to offset and then copy data however I am struggling to do this.

    My code at the moment:

    Please Login or Register  to view this content.
    Any help would be much appreciated.

    Thanks
    Last edited by megan-jane; 12-31-2013 at 09:10 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,849

    Re: Need help on offset and copy coding using VBA

    Welcome to the Forum megan-jane!

    You have shown some code that does something, but you haven't said how that something is different than what you want it to do.

    What exactly do you want your code to do?
    What is the problem with the code you provided?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    12-30-2013
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Need help on offset and copy coding using VBA

    Hi, thank you for your reply.

    I have attached the Excel file I am using and what I need (on the Updated Forecast worksheet) is to copy the forecasts (C4:C7) coloured in pink to the 'Home' worksheet. This I can do no problem but every time I run the code I need to copy the next set of forecasts so C9:C12, C14:17, etc... I have managed to use similar code in order to paste data in this manner but I cannot seem to copy and offset together?

    I'm sorry, I'm not very good at explaining things and this seems quite complicated to me which makes it worse!

    Megan
    Attached Files Attached Files
    Last edited by megan-jane; 01-06-2014 at 06:44 PM.

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need help on offset and copy coding using VBA

    Not sure about how to incorporate into your code, but if you can use a helper cell (in this Case I used Range("I1")). First I placed a 4. It will then Offset the selection to copy each time. Hope that helps.

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-30-2013
    Location
    Glasgow, Scotland
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Need help on offset and copy coding using VBA

    This worked! Thank you very much

    It had been bugging me for ages!!

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need help on offset and copy coding using VBA

    You're welcome. Glad to help out and thanks for the feedback.

+ 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. Macro Problem with VBA need Help (copy past cells with macro and message box)
    By Nissort in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-25-2013, 12:17 PM
  2. Problem using formulas within macro + problem with defined name.
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2011, 04:39 AM
  3. Macro Problem - Having Original Macro Worksheet Open
    By Nosnum in forum Excel General
    Replies: 1
    Last Post: 12-03-2008, 03:21 PM
  4. [SOLVED] Color Row Macro Problem, adapted from Patrick Malloy macro
    By SteveC in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-21-2006, 07:30 AM
  5. [SOLVED] Problem in updating all worksheets of a workbook using a macro that calls another macro
    By saai_ram@yahoo.com in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-20-2006, 01:25 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