+ Reply to Thread
Results 1 to 8 of 8

simple... HasFormula ?

Hybrid View

  1. #1
    mark kubicki
    Guest

    simple... HasFormula ?

    please... what's my error?

    Dim sglEndSum As Single

    If Range("D" & sglEndSum).HasFormula = True Then
    MsgBox Range("D" & sglEndSum).Address & " contains a formula..."
    Range("D" & sglEndSum).Value = "not any more !"
    End If


    thanks in advance,
    mark



  2. #2
    Ardus Petus
    Guest

    Re: simple... HasFormula ?

    Since rows can reach up to 65536:
    Dim sglEndSum As Long

    But this does not keep your code from running OK by me.

    HTH
    --
    AP

    "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de news:
    %23ZIu83PdGHA.1456@TK2MSFTNGP04.phx.gbl...
    > please... what's my error?
    >
    > Dim sglEndSum As Single
    >
    > If Range("D" & sglEndSum).HasFormula = True Then
    > MsgBox Range("D" & sglEndSum).Address & " contains a
    > formula..."
    > Range("D" & sglEndSum).Value = "not any more !"
    > End If
    >
    >
    > thanks in advance,
    > mark
    >




  3. #3
    mark kubicki
    Guest

    Re: simple... HasFormula ?

    I'm getting a

    method 'range' of object _worksheet failed

    message

    -m.

    "Ardus Petus" <ardus.petus@laposte.net> wrote in message
    news:%238P737PdGHA.1436@TK2MSFTNGP05.phx.gbl...
    > Since rows can reach up to 65536:
    > Dim sglEndSum As Long
    >
    > But this does not keep your code from running OK by me.
    >
    > HTH
    > --
    > AP
    >
    > "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de news:
    > %23ZIu83PdGHA.1456@TK2MSFTNGP04.phx.gbl...
    >> please... what's my error?
    >>
    >> Dim sglEndSum As Single
    >>
    >> If Range("D" & sglEndSum).HasFormula = True Then
    >> MsgBox Range("D" & sglEndSum).Address & " contains a
    >> formula..."
    >> Range("D" & sglEndSum).Value = "not any more !"
    >> End If
    >>
    >>
    >> thanks in advance,
    >> mark
    >>

    >
    >




  4. #4
    Ardus Petus
    Guest

    Re: simple... HasFormula ?

    With debugger, check the value of sglEndSum. Maybe it is zero.

    --
    AP

    "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de news:
    %23064Z$PdGHA.4264@TK2MSFTNGP05.phx.gbl...
    > I'm getting a
    >
    > method 'range' of object _worksheet failed
    >
    > message
    >
    > -m.
    >
    > "Ardus Petus" <ardus.petus@laposte.net> wrote in message
    > news:%238P737PdGHA.1436@TK2MSFTNGP05.phx.gbl...
    >> Since rows can reach up to 65536:
    >> Dim sglEndSum As Long
    >>
    >> But this does not keep your code from running OK by me.
    >>
    >> HTH
    >> --
    >> AP
    >>
    >> "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de
    >> news: %23ZIu83PdGHA.1456@TK2MSFTNGP04.phx.gbl...
    >>> please... what's my error?
    >>>
    >>> Dim sglEndSum As Single
    >>>
    >>> If Range("D" & sglEndSum).HasFormula = True Then
    >>> MsgBox Range("D" & sglEndSum).Address & " contains a
    >>> formula..."
    >>> Range("D" & sglEndSum).Value = "not any more !"
    >>> End If
    >>>
    >>>
    >>> thanks in advance,
    >>> mark
    >>>

    >>
    >>

    >
    >




  5. #5
    Bob Phillips
    Guest

    Re: simple... HasFormula ?

    Also you don't need to test = True

    If Range("D" & sglEndSum).HasFormula Then


    --
    HTH

    Bob Phillips

    (remove xxx from email address if mailing direct)

    "Ardus Petus" <ardus.petus@laposte.net> wrote in message
    news:%23BEh4KQdGHA.3900@TK2MSFTNGP05.phx.gbl...
    > With debugger, check the value of sglEndSum. Maybe it is zero.
    >
    > --
    > AP
    >
    > "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de news:
    > %23064Z$PdGHA.4264@TK2MSFTNGP05.phx.gbl...
    > > I'm getting a
    > >
    > > method 'range' of object _worksheet failed
    > >
    > > message
    > >
    > > -m.
    > >
    > > "Ardus Petus" <ardus.petus@laposte.net> wrote in message
    > > news:%238P737PdGHA.1436@TK2MSFTNGP05.phx.gbl...
    > >> Since rows can reach up to 65536:
    > >> Dim sglEndSum As Long
    > >>
    > >> But this does not keep your code from running OK by me.
    > >>
    > >> HTH
    > >> --
    > >> AP
    > >>
    > >> "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de
    > >> news: %23ZIu83PdGHA.1456@TK2MSFTNGP04.phx.gbl...
    > >>> please... what's my error?
    > >>>
    > >>> Dim sglEndSum As Single
    > >>>
    > >>> If Range("D" & sglEndSum).HasFormula = True Then
    > >>> MsgBox Range("D" & sglEndSum).Address & " contains a
    > >>> formula..."
    > >>> Range("D" & sglEndSum).Value = "not any more !"
    > >>> End If
    > >>>
    > >>>
    > >>> thanks in advance,
    > >>> mark
    > >>>
    > >>
    > >>

    > >
    > >

    >
    >




  6. #6
    mark kubicki
    Guest

    Re: simple... HasFormula ?

    it had been "zero-ing out"... thanks



    "Bob Phillips" <bob.NGs@googlemailxxx.com> wrote in message
    news:OPJ10dQdGHA.3948@TK2MSFTNGP03.phx.gbl...
    > Also you don't need to test = True
    >
    > If Range("D" & sglEndSum).HasFormula Then
    >
    >
    > --
    > HTH
    >
    > Bob Phillips
    >
    > (remove xxx from email address if mailing direct)
    >
    > "Ardus Petus" <ardus.petus@laposte.net> wrote in message
    > news:%23BEh4KQdGHA.3900@TK2MSFTNGP05.phx.gbl...
    >> With debugger, check the value of sglEndSum. Maybe it is zero.
    >>
    >> --
    >> AP
    >>
    >> "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de
    >> news:
    >> %23064Z$PdGHA.4264@TK2MSFTNGP05.phx.gbl...
    >> > I'm getting a
    >> >
    >> > method 'range' of object _worksheet failed
    >> >
    >> > message
    >> >
    >> > -m.
    >> >
    >> > "Ardus Petus" <ardus.petus@laposte.net> wrote in message
    >> > news:%238P737PdGHA.1436@TK2MSFTNGP05.phx.gbl...
    >> >> Since rows can reach up to 65536:
    >> >> Dim sglEndSum As Long
    >> >>
    >> >> But this does not keep your code from running OK by me.
    >> >>
    >> >> HTH
    >> >> --
    >> >> AP
    >> >>
    >> >> "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de
    >> >> news: %23ZIu83PdGHA.1456@TK2MSFTNGP04.phx.gbl...
    >> >>> please... what's my error?
    >> >>>
    >> >>> Dim sglEndSum As Single
    >> >>>
    >> >>> If Range("D" & sglEndSum).HasFormula = True Then
    >> >>> MsgBox Range("D" & sglEndSum).Address & " contains a
    >> >>> formula..."
    >> >>> Range("D" & sglEndSum).Value = "not any more !"
    >> >>> End If
    >> >>>
    >> >>>
    >> >>> thanks in advance,
    >> >>> mark
    >> >>>
    >> >>
    >> >>
    >> >
    >> >

    >>
    >>

    >
    >




  7. #7
    Bob Phillips
    Guest

    Re: simple... HasFormula ?

    Also you don't need to test = True

    If Range("D" & sglEndSum).HasFormula Then


    --
    HTH

    Bob Phillips

    (remove xxx from email address if mailing direct)

    "Ardus Petus" <ardus.petus@laposte.net> wrote in message
    news:%23BEh4KQdGHA.3900@TK2MSFTNGP05.phx.gbl...
    > With debugger, check the value of sglEndSum. Maybe it is zero.
    >
    > --
    > AP
    >
    > "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de news:
    > %23064Z$PdGHA.4264@TK2MSFTNGP05.phx.gbl...
    > > I'm getting a
    > >
    > > method 'range' of object _worksheet failed
    > >
    > > message
    > >
    > > -m.
    > >
    > > "Ardus Petus" <ardus.petus@laposte.net> wrote in message
    > > news:%238P737PdGHA.1436@TK2MSFTNGP05.phx.gbl...
    > >> Since rows can reach up to 65536:
    > >> Dim sglEndSum As Long
    > >>
    > >> But this does not keep your code from running OK by me.
    > >>
    > >> HTH
    > >> --
    > >> AP
    > >>
    > >> "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de
    > >> news: %23ZIu83PdGHA.1456@TK2MSFTNGP04.phx.gbl...
    > >>> please... what's my error?
    > >>>
    > >>> Dim sglEndSum As Single
    > >>>
    > >>> If Range("D" & sglEndSum).HasFormula = True Then
    > >>> MsgBox Range("D" & sglEndSum).Address & " contains a
    > >>> formula..."
    > >>> Range("D" & sglEndSum).Value = "not any more !"
    > >>> End If
    > >>>
    > >>>
    > >>> thanks in advance,
    > >>> mark
    > >>>
    > >>
    > >>

    > >
    > >

    >
    >




  8. #8
    Bob Phillips
    Guest

    Re: simple... HasFormula ?

    Also you don't need to test = True

    If Range("D" & sglEndSum).HasFormula Then


    --
    HTH

    Bob Phillips

    (remove xxx from email address if mailing direct)

    "Ardus Petus" <ardus.petus@laposte.net> wrote in message
    news:%23BEh4KQdGHA.3900@TK2MSFTNGP05.phx.gbl...
    > With debugger, check the value of sglEndSum. Maybe it is zero.
    >
    > --
    > AP
    >
    > "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de news:
    > %23064Z$PdGHA.4264@TK2MSFTNGP05.phx.gbl...
    > > I'm getting a
    > >
    > > method 'range' of object _worksheet failed
    > >
    > > message
    > >
    > > -m.
    > >
    > > "Ardus Petus" <ardus.petus@laposte.net> wrote in message
    > > news:%238P737PdGHA.1436@TK2MSFTNGP05.phx.gbl...
    > >> Since rows can reach up to 65536:
    > >> Dim sglEndSum As Long
    > >>
    > >> But this does not keep your code from running OK by me.
    > >>
    > >> HTH
    > >> --
    > >> AP
    > >>
    > >> "mark kubicki" <mark@tillotsondesign.com> a écrit dans le message de
    > >> news: %23ZIu83PdGHA.1456@TK2MSFTNGP04.phx.gbl...
    > >>> please... what's my error?
    > >>>
    > >>> Dim sglEndSum As Single
    > >>>
    > >>> If Range("D" & sglEndSum).HasFormula = True Then
    > >>> MsgBox Range("D" & sglEndSum).Address & " contains a
    > >>> formula..."
    > >>> Range("D" & sglEndSum).Value = "not any more !"
    > >>> End If
    > >>>
    > >>>
    > >>> thanks in advance,
    > >>> mark
    > >>>
    > >>
    > >>

    > >
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1