ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   simple... HasFormula ? (https://www.excelbanter.com/excel-programming/361181-simple-hasformula.html)

mark kubicki

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



Ardus Petus

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" a écrit dans le message de news:
...
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




mark kubicki

simple... HasFormula ?
 
I'm getting a

method 'range' of object _worksheet failed

message

-m.

"Ardus Petus" wrote in message
...
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" a écrit dans le message de news:
...
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






Ardus Petus

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

--
AP

"mark kubicki" a écrit dans le message de news:
...
I'm getting a

method 'range' of object _worksheet failed

message

-m.

"Ardus Petus" wrote in message
...
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" a écrit dans le message de
news: ...
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








Bob Phillips[_14_]

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" wrote in message
...
With debugger, check the value of sglEndSum. Maybe it is zero.

--
AP

"mark kubicki" a écrit dans le message de news:
...
I'm getting a

method 'range' of object _worksheet failed

message

-m.

"Ardus Petus" wrote in message
...
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" a écrit dans le message de
news: ...
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










mark kubicki

simple... HasFormula ?
 
it had been "zero-ing out"... thanks



"Bob Phillips" wrote in message
...
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" wrote in message
...
With debugger, check the value of sglEndSum. Maybe it is zero.

--
AP

"mark kubicki" a écrit dans le message de
news:
...
I'm getting a

method 'range' of object _worksheet failed

message

-m.

"Ardus Petus" wrote in message
...
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" a écrit dans le message de
news: ...
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













All times are GMT +1. The time now is 02:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com