Results 1 to 4 of 4

Excel 2007 : Macro to fill in a relative position

Threaded View

  1. #1
    Registered User
    Join Date
    03-12-2011
    Location
    Knoxville, TN
    MS-Off Ver
    Excel 2007
    Posts
    8

    Macro to fill in a relative position

    I'm new to Excel, learning as I go along, and I have a question. I have a macro that is supposed to carry numbers from one sheet to another, but it doesn't. It over writes the same cell everytime. I want it to post the numbers by date (3/11/2011, 3/12/2011, etc) but it continuously writes a new number into the same date. Here is my macro. I'm new to Excel, please remember that, so it may be a little long.



    Sub CopyNumbersToRespectiveWorksheet()
    '
    ' CopyNumbersToRespectiveWorksheet Macro
    ' Copies the numbers to their respective worksheets
    '
    ' Keyboard Shortcut: Ctrl+Shift+C
    '
        Range("M6").Select
        Selection.Copy
        Sheets("Hard Copper").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("N6").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Hard Copper").Select
        Range("F136").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("O6").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Hard Copper").Select
        Range("H136").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("P6").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Hard Copper").Select
        Range("J136").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("M7").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Brit LB.").Select
        Range("D137").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("N7").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Brit LB.").Select
        Range("F137").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("O7").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Brit LB.").Select
        Range("H137").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("P7").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Brit LB.").Select
        Range("J137").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("M8").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Crude Oil").Select
        Range("D146").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("N8").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Crude Oil").Select
        Range("F146").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("O8").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Crude Oil").Select
        Range("H146").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("P8").Select
        Application.CutCopyMode = False
        Selection.Copy
        Sheets("Crude Oil").Select
        Range("J146").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        Sheets("Import").Select
        Range("M9").Select
        Application.CutCopyMode = False
        Selection.Copy
        ActiveWindow.ScrollWorkbookTabs Position:=xlLast
        ActiveWindow.ScrollWorkbookTabs Position:=xlLast
        Sheets("Euro").Select
        Range("D137").Select
        Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
            :=False, Transpose:=False
        ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
        Sheets("Import").Select
        Range("N9").Select
       
    End Sub
    that is basically it.........anyone with any help to offer would become my new best friend

    Otis
    Last edited by OtisMardres; 03-15-2011 at 07:18 PM. Reason: Problem solved

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