Results 1 to 10 of 10

Match Date and Copy Paste - Object Required Error

Threaded View

  1. #1
    Registered User
    Join Date
    09-05-2011
    Location
    St. John's, Canada
    MS-Off Ver
    Excel 2010
    Posts
    70

    Match Date and Copy Paste - Object Required Error

    Hey Everyone,

    This is my first post. I'm very new to VB, well coding in general, I did some C++ back in the day but that was it. I'm trying to Build a Macro that takes data from one worksheet and places it into the corresponding row of another worksheet which has the same initial date. I've gotten this far but I keep getting a Object Required Error for the line that reads If Today.Value = Range(A, i).Value Then. What I'm trying to say in this statement is that if the date from Daily Report matches the date in the specified A cell (i=1 to 700) then paste date in the cell Bi. This code is going to get a lot bigger but right I'm starting small to work towards something bigger. This is what I have so far. Any Advice would be great.


    Sub LookCopy()
    
    Dim Today As Variant
    Dim i As Variant
    
    Sheets("Daily Report").Select
    
    Today = Range("C6").Value
    
    For i = 1 To 700
    
    Sheets("Production Data - 09").Select
    If Today.Value = Range(A, i).Value Then
    Sheets("Daily Report").Select
    Range("E30").Select
    Selection.Copy
    Sheets("Production Data-09").Select
    Range(B, i).Select
    Selection.PasteSpecial Paste:=xlPasteValues
    
    End If
    
    Next i
    
    End Sub
    Last edited by ashleys.nl; 09-13-2011 at 12:15 PM.

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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