target.value

C

Curt

= isText
If Target.Column = 12 And Target.Value <= 0 And IsText(Target.Value) Then _
Call Announcer(Target)
used to working with numeric blanked on this text issue
isText was isNumeric
does this look right
Thanks
 
B

Bernie Deitrick

Curt,

Your comparison

Target.Value <= 0

will get you in trouble, if target.value is actually text. Try:

If Target.Column = 12 And CDbl(Target.Value) <= 0 And IsText(Target.Value) Then _
Call Announcer(Target)


HTH,
Bernie
MS Excel MVP
 
C

Curt

Thanks
One more question. The target cell should all ways be text. Is there any
other change I should use?
Sure appreciate the responce
 
B

Bernie Deitrick

Curt,

It depends on what your target values are. Are they strings that look like
numbers? Some examples of what you expect would help...

Bernie
 
C

Curt

no nbrs will all ways be text. the text is entered into a cell on another
sheet then pasted back to the target cell it is shrunk to fit.
Horse drawn carriage Fire truck etc. Can not expect to have any resemblance
to nbrs.
Better desc I hope.
Thanks
 
B

Bernie Deitrick

Curt,

You need to explain the logic of your desired procedure: y ou have a check
for the number being less than 0, so that obviously won't be applicable.

Bernie
 
C

Curt

Will enclose code I am useing. Target in end will be text entered in a cell
on another sheet. Then you move out of cell and then click on an option
button which pastes that cell back into main sheet. I know I have (0) in
there this is trying to get it to trigger. Have not used text to trigger
before. As your post CDbl is new to me. Have been having trouble with IsText
when compileing.any way heres the code that I have done something wrong with
Thanks for looking


If Target.Column = 12 And Target.Value > 1 And IsNumeric(Target.Value) Then _
Call Announcer(Target)


Public Sub Announcer(ByVal Target As Range)
Dim wksSummary As Worksheet
Dim rngPaste As Range
Set wksSummary = Sheets("Announcer")
Set rngPaste = wksSummary.Cells(65536, "A").End(xlUp).Offset(1, 0)
Application.EnableEvents = False
Set rngPaste = rngPaste.Offset(0, 0)
Union(Target.Offset(0, -11), Target.Offset(0, 8), _
Target.Offset(0, 7), Target.Offset(0, 5), _
Target).Copy Destination:=rngPaste
rngPaste.Offset(0, 7) = Target
Application.EnableEvents = True
End Sub
 

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