View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Pasting in a unique row for each unique date

there is a typo in the code:

Dim rng as Range
Dim res as Variant
With worksheets("BlowDown Log")
set rng = .Range(.cells(1,1),.cells(1,1).End(xldown))
End with
res = Application.Match(clng(Range("D21")),rng,0)
if not iserror(res) then ' < == correction made
Range("F23").copy
rng(res).offset(0,5).Pastespecial xlValues
else
rng.offset(rng.rows.count,0).Resize(1,1).Value = Range("D21")
rng.offset(rng.rows.count,0).Resize(1,1).offset(0, 5).PasteSpecial xlValues
end if

--
Regards,
Tom Ogilvy

"sowetoddid " wrote in message
...
The code is generating a Type 13 mismatch error. Any ideas. Microsoft
suggests that this problem comes from comparing with String, but the
code you provided is using Variant, so that should be fine....I am just
guessing. Please help.

The error occurs on the following line...

rng(res).offset(0,5).PasteSpecial xlValues



Thanks


---
Message posted from http://www.ExcelForum.com/