+ Reply to Thread
Results 1 to 3 of 3

Using a macro to record and paste to new spread sheet not working

  1. #1
    Registered User
    Join Date
    01-06-2012
    Location
    Rochester NY
    MS-Off Ver
    Excel 2007
    Posts
    20

    Using a macro to record and paste to new spread sheet not working

    Hi guys,

    I am trying to record a macro that will go thru a drop down list, copy the first line, paste into a different spread sheet and repeat until the list has been gone thru. Everything seems to work fine when recording - I go thru the drop down list, copy and paste special values and number formats and repeat. However, when I play the macro the only information that comes up in all of the rows is the same data that I have left on my screen that I copied from.
    Last edited by Vaibhav; 03-21-2012 at 07:06 AM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Using a macro to record and paste to new spread sheet not working

    It will be good if you attach the sample workbook & code that you have been working on, so we can troubleshoot better.
    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]

  3. #3
    Registered User
    Join Date
    01-06-2012
    Location
    Rochester NY
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Using a macro to record and paste to new spread sheet not working

    Here is a spread sheet that uses the same type of information that i am working with. My problem is that when I go thru the drop down the macro doesnt seem to like this and will not feed the correct information from the Weekly totals tab to the Totals tab at the end.

    This is the macro i have tried to run by coping only the first line of information from each drop down, week 11/4, and pasting to the totals page for the seperate individuals.


    Keyboard Shortcut: Ctrl+p
    '
    Sheets("Weekly totals").Select
    ActiveCell.Offset(3, -2).Range("A1:F1").Select
    Selection.Copy
    Sheets("Totals").Select
    ActiveCell.Offset(0, 1).Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
    xlNone, SkipBlanks:=False, Transpose:=False
    Sheets("Weekly totals").Select
    Application.CutCopyMode = False
    ActiveCell.Range("A1:F1").Select
    Selection.Copy
    Sheets("Totals").Select
    ActiveCell.Offset(1, 0).Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
    xlNone, SkipBlanks:=False, Transpose:=False
    Sheets("Weekly totals").Select
    Application.CutCopyMode = False
    ActiveCell.Range("A1:F1").Select
    Selection.Copy
    Sheets("Totals").Select
    ActiveCell.Offset(1, 0).Range("A1").Select
    Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
    xlNone, SkipBlanks:=False, Transpose:=False
    Application.CutCopyMode = False
    Sheets("Weekly totals").Select
    End Sub
    Attached Files Attached Files

+ Reply to 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