Excel 2003: I don't write VBA but I can do some tweaking, I have code that moves data according to day of the week, Originaly this code used the cut method and that worked but I need it to copy and paste special. I used the macro recorder to record something where you Past Special so I could see what the syntax was. I have tried it in several spots but I can not make it work, this is the code as it stands now:
Option Explicit
Sub MoveDayOfWeek()
Dim DayOfWeek As String
Dim LR As Long
LR = Range("E" & Rows.Count).End(xlUp).Row
DayOfWeek = Format(CDate(Date), "dddd")
Select Case DayOfWeek
Case "Monday"
Range("E10:E" & LR).Copy Destination:=Range("H10")
Case "Tuesday"
Range("E10:E" & LR).Copy Destination:=Range("M10")
Case "Wednesday"
Range("E10:E" & LR).Copy Destination:=Range("R10")
Case "Thursday"
Range("E10:E" & LR).Copy Destination:=Range("W10")
Case "Friday"
Range("E10:E" & LR).Copy Destination:=Range("AB10")
Case "Saturday"
Range("E10:E" & LR).Copy Destination:=Range("AG10")
Case "Sunday"
Range("E10:E" & LR).Copy Destination:=Range("AL10")
End Select
Application.CutCopyMode = False
Call MoveDayOfWeekScans
End Sub
the error message is "Copy Method of Range Class Failed and it highlights Saturday because today is saturday and that is where it is trying to move that data. I am guessing I get the message because it does not know how I want to move it or what I want to do with it? That is why I need this:
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
But I have tried placing it in several places and I am just not getting it right, could I get a little help and if you have time maybe small explantion of what I was doing wrong?
Thanks Ken
Bookmarks