View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge Nick Hodge is offline
external usenet poster
 
Posts: 1,173
Default Copy value problem... if "" then 0

Ste

No need to copy and paste, just assign the value directly

Sub CopyData()
Dim dVal As Double
dVal = IIf(IsEmpty(ActiveCell.Offset(0, 10).Value), 0 _
, ActiveCell.Offset(0, 10).Value)
Sheets("Datasheet").Range("I65536").End(xlUp).Offs et(1, 0).Value = dVal
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"ste mac" wrote in message
om...
Hi, the code below will copy the ActiveCell.Offset(0, 10).value... but
if
ActiveCell.Offset(0, 10).value has nothing in it, I need it to paste a
0 instead of nothing...

ActiveCell.Offset(0, 10).Copy
Sheets("Datasheet").Range("I65536").End(xlUp).Offs et(1,
0).PasteSpecial Paste:=xlPasteValues

Can anybody help please...

ste