View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Elkar Elkar is offline
external usenet poster
 
Posts: 964
Default macro or if statement

I'm not sure I understand what exactly you're trying to do. Do you want a
formula that you can copy down column A to display the contents of cell A1 if
the corresponding cell in column D contains data? If so, then try this:

=IF(D2<"",$A$1,"")

The use of the $ symbols will prevent the cell reference from incrementing
when the formula is copied.

HTH,
Elkar


"CHARI" wrote:

If I have a value in a1 and I want that copied to a2 only if I have a value
in d2. I tried an If statement but I ended up removing some of the data from
column a because the if statement said if d2<"",a1,""

any way to copy the formula better or would a macro work better?