Closed Thread
Results 1 to 3 of 3

Macro Editing

  1. #1
    Registered User
    Join Date
    01-22-2013
    Location
    Newcastle under Lyme, England
    MS-Off Ver
    Excel 2010
    Posts
    20

    Macro Editing

    HI,

    I have recorded a macro to move data from one spreadsheet to specific cells in another, this all works fine for me.

    My issue is that i want this to be done on a monthly basis but one of the file names will change each month and the original dat will be on a different row each month.

    To give you a better idea. I will have sales data for several months in one file, at present i am down to row 135 which is for March 2013, the macro will currently copy this data and paste it to specific cells within the March accounts. However when we move into April i will now want the macro to pick up off row 136 and paste it to a completley different file, the April accounts.

    This is the first part of the Macro that i have created.

    Sub Sales_Summary()
    '
    ' Sales_Summary Macro
    ' To transfer sales from Sales Analysis v5 to the Sales Summary tab
    '

    '
    Windows("Sales Analysis v5.xlsx").Activate
    Range("T135:U135").Select
    Selection.Copy
    Windows("Data 1303.xlsm").Activate
    Range("C10").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=True
    Windows("Sales Analysis v5.xlsx").Activate
    Range("V135:W135").Select
    Selection.Copy
    Windows("Data 1303.xlsm").Activate
    Range("C13").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=True
    Windows("Sales Analysis v5.xlsx").Activate
    Range("X135:Y135").Select
    Selection.Copy
    Windows("Data 1303.xlsm").Activate
    Range("C18").Select
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=True
    End Sub


    Any ideas?

    Cheers

    Chris

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,760

    Re: Macro Editing

    Duplicate Thread

    Original is here:
    http://www.excelforum.com/excel-prog...o-editing.html


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: Macro Editing

    Thanks Sixthsense.

    Thread closed.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

Closed Thread

Thread Information

Users Browsing this Thread

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

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