View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Writing formulas ...

Just a heads up:
This would never adjust the cell references in the formula (contrary to the
OP's specification - probably overlooked) and the comma is used with the
Formula property regardless of the regional settings (not semi-colon).

--
Regards,
Tom Ogilvy



"Bob Phillips" wrote in message
...
Sige,

Dim i As Long

For i = 6 To Cells(Rows.Count, "C").End(xlUp).Row

Cells(i, "A").Formula = _
"=IF(IF(ISERROR(VLOOKUP(C6,ACCOUNTS,1,FALSE)), " & _
"B5,VLOOKUP(C6,ACCOUNTS,1,FALSE))=C6,""""," & _
"IF(ISERROR(VLOOKUP(C6,ACCOUNTS,1,FALSE))," & _
"B5,VLOOKUP(C6,ACCOUNTS,1,FALSE))&C6)"

Cells(i, "B").Formula = _


"=IF(ISERROR(VLOOKUP(C6,ACCOUNTS,1,FALSE)),B5,VLOO KUP(C6,ACCOUNTS,1,FALSE))"
Next i

I had to use , as a separator. You might need ; you might not try tyhem
both.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Sige" wrote in message
oups.com...
Hi There,

Is it possible to do the following?

1. In column B from row 6 downwards:
(***up to last row in column C*** (no empty rows))
WRITE THE FORMULA:
(for B6:)
=IF(ISERROR(VLOOKUP(C6;ACCOUNTS;1;FALSE));B5;VLOOK UP
(C6;ACCOUNTS;1;FALSE))

("increasing" for B7 as copying down the relative formula manually)

2. In column A from row 6 donwards:

WRITE THE FORMULA:
(for A6:)


=IF(IF(ISERROR(VLOOKUP(C6;ACCOUNTS;1;FALSE));B5;VL OOKUP(C6;ACCOUNTS;1;FALSE)
)=C6;"";IF(ISERROR(VLOOKUP(C6;ACCOUNTS;1;FALSE));B 5;VLOOKUP(C6;ACCOUNTS;1;

FA
LSE))&C6)

Small step for guru? ... too big step for me!

So, Any help really appreciated! :o)
Sige