N
nectarinesupreme
Hi all,
I've posted about this problem later last week, but I still haven't
been able to fix up my code. Thanks for all the help, I'm really not
too great figuring out the errors.
The issue is going to be in the Set c = Range... line up until the End
If line. All of the other code has previously worked until I added
this new part. Basically the code is trying to copy and paste certain
data from one spreadsheet to another in a specific location. This one
part is trying to find the line in the other spreadsheet where it
should copy - depending a match within the G column. If it doesn't
find a match, it isn't supposed to copy anywhere. I'm currently
getting a type mismatch error on the Set c = Range... line. I really
don't know VB syntax at all, so I'm not sure what's wrong. Thanks!
Selection.Copy
x = ActiveCell
Windows("VOD Master List as of 06-19-07.xls").Activate
Set c = Range("G1:G4633").Find(What:=x, LookIn:=xlFormulas,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False, SearchFormat:=False).Activate
If Not c Is Nothing Then
c.Activate
Else
Exit Sub
End If
Windows("May as of 06-01-07.xls").Activate
datecomp = "A1"
cellshow = "B" & ActiveCell.Row
cellSTB = "H" & ActiveCell.Row
cellorder = "I" & ActiveCell.Row
testdate = "D" & ActiveCell.Row
Worksheets("Sheet5").Range(cellshow).Font.Italic = True
Worksheets("Sheet5").Range(cellshow).Font.Bold = True
Range(cellSTB).Copy
If (Range(testdate) > Range(datecomp)) Then
Windows("VOD Master List as of 06-19-07.xls").Activate
cellSTBpaste = "Y" & ActiveCell.Row
cellorderpaste = "X" & ActiveCell.Row
Else
Windows("VOD Master List as of 06-19-07.xls").Activate
cellSTBpaste = "AB" & ActiveCell.Row
cellorderpaste = "AA" & ActiveCell.Row
End If
Range(cellSTBpaste).PasteSpecial
Windows("May as of 06-01-07.xls").Activate
Range(cellorder).Copy
Windows("VOD Master List as of 06-19-07.xls").Activate
Range(cellorderpaste).PasteSpecial
I've posted about this problem later last week, but I still haven't
been able to fix up my code. Thanks for all the help, I'm really not
too great figuring out the errors.
The issue is going to be in the Set c = Range... line up until the End
If line. All of the other code has previously worked until I added
this new part. Basically the code is trying to copy and paste certain
data from one spreadsheet to another in a specific location. This one
part is trying to find the line in the other spreadsheet where it
should copy - depending a match within the G column. If it doesn't
find a match, it isn't supposed to copy anywhere. I'm currently
getting a type mismatch error on the Set c = Range... line. I really
don't know VB syntax at all, so I'm not sure what's wrong. Thanks!
Selection.Copy
x = ActiveCell
Windows("VOD Master List as of 06-19-07.xls").Activate
Set c = Range("G1:G4633").Find(What:=x, LookIn:=xlFormulas,
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False, SearchFormat:=False).Activate
If Not c Is Nothing Then
c.Activate
Else
Exit Sub
End If
Windows("May as of 06-01-07.xls").Activate
datecomp = "A1"
cellshow = "B" & ActiveCell.Row
cellSTB = "H" & ActiveCell.Row
cellorder = "I" & ActiveCell.Row
testdate = "D" & ActiveCell.Row
Worksheets("Sheet5").Range(cellshow).Font.Italic = True
Worksheets("Sheet5").Range(cellshow).Font.Bold = True
Range(cellSTB).Copy
If (Range(testdate) > Range(datecomp)) Then
Windows("VOD Master List as of 06-19-07.xls").Activate
cellSTBpaste = "Y" & ActiveCell.Row
cellorderpaste = "X" & ActiveCell.Row
Else
Windows("VOD Master List as of 06-19-07.xls").Activate
cellSTBpaste = "AB" & ActiveCell.Row
cellorderpaste = "AA" & ActiveCell.Row
End If
Range(cellSTBpaste).PasteSpecial
Windows("May as of 06-01-07.xls").Activate
Range(cellorder).Copy
Windows("VOD Master List as of 06-19-07.xls").Activate
Range(cellorderpaste).PasteSpecial