coding question

P

PeCoNe

Hallo,

I wrote following subroutine:

Sub prcEUR()
If IEXtm > EURetm Then
EURtm = EURetm
Else
EURtm = IEXtm
End If
If IsEmpty(EURlpr) Or EURpr < EURlpr Then
EURltm = EURtm
EURlpr = EURpr
End If
If IsEmpty(EURhpr) Or EURpr > EURhpr Then
EURhtm = EURtm
EURhpr = EURpr
End If
End Sub

IEXtm and EURetm and EUR... are named fields in my excel sheet.
VBA doesn't recognize these fields.
how can i solve that.

bye Peter Maljers
 
C

Claus Busch

Hi Peter,

Am Wed, 26 Dec 2012 17:05:27 +0100 schrieb PeCoNe:
IEXtm and EURetm and EUR... are named fields in my excel sheet.
VBA doesn't recognize these fields.
how can i solve that.

your names are range names and so you must use them as ranges
Range("IEXtm") or [IEXtm]

If IEXtm > EURetm Then
EURtm = EURetm
Else
EURtm = IEXtm
End If

change to:
[EURtm] = IIf([IEXtm] > [EURetm], [EURetm], [IEXtm])


Regards
Claus Busch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top