Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default What am I doing wrong....!!!


Hello,

Hope someone can help with this please...

Using VB in Excel....

A value is entered into a cell in Excel and plotted on my line
chart...

I need a message box to be shown when the value is less than 15,250 or
above 15,310. I cannot get the msgbox to show up....The value is being
entered in cell B1..I have tried to use B1 in the code as an
alternative to TextBox1 but still doesn't work....

My attempt at coding is as follows:

Sub Add_Entry()
Range("A7").End(xlDown).Offset(1, 0).Select
ActiveCell.Value = TextBox1.Value
TextBox1.Value = ""
Range("B1").Select
If TextBox1.Value 15310 Then MsgBox "Outside Limits - Schedule
Maintenance", vbCritical + vbOKOnly, "Urgent"

End Sub


hope someone can help,

thanks in advance
simon..


--
squoggy
------------------------------------------------------------------------
squoggy's Profile: http://www.excelforum.com/member.php...o&userid=23561
View this thread: http://www.excelforum.com/showthread...hreadid=376005

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default What am I doing wrong....!!!

You can use data - validation to do this. Look at data validation
http://www.contextures.com/xlDataVal01.html

--
HTH...

Jim Thomlinson


"squoggy" wrote:


Hello,

Hope someone can help with this please...

Using VB in Excel....

A value is entered into a cell in Excel and plotted on my line
chart...

I need a message box to be shown when the value is less than 15,250 or
above 15,310. I cannot get the msgbox to show up....The value is being
entered in cell B1..I have tried to use B1 in the code as an
alternative to TextBox1 but still doesn't work....

My attempt at coding is as follows:

Sub Add_Entry()
Range("A7").End(xlDown).Offset(1, 0).Select
ActiveCell.Value = TextBox1.Value
TextBox1.Value = ""
Range("B1").Select
If TextBox1.Value 15310 Then MsgBox "Outside Limits - Schedule
Maintenance", vbCritical + vbOKOnly, "Urgent"

End Sub


hope someone can help,

thanks in advance
simon..


--
squoggy
------------------------------------------------------------------------
squoggy's Profile: http://www.excelforum.com/member.php...o&userid=23561
View this thread: http://www.excelforum.com/showthread...hreadid=376005


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default What am I doing wrong....!!!


Hello Simon,

You can correct this problem this way...

CORRECTION #1 MOVE CLEARING THE TEXTBOX

Sub Add_Entry()
Range("A7").End(xlDown).Offset(1, 0).Select
ActiveCell.Value = TextBox1.Value
Range("B1").Select
If TextBox1.Value 15310 Then MsgBox "Outside Limits - Schedul
Maintenance", vbCritical + vbOKOnly, "Urgent"
TextBox1.Value=""
End Sub


Sincerely,
Leith Ros

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=37600

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default What am I doing wrong....!!!


Fantastic..many thanks for the prompt response..

I had been staring at the code all day and now its working...

Many thanks once again..

Simon..

--
squogg
-----------------------------------------------------------------------
squoggy's Profile: http://www.excelforum.com/member.php...fo&userid=2356
View this thread: http://www.excelforum.com/showthread.php?threadid=37600

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
What am I doing wrong? Jeff New Users to Excel 4 March 6th 05 03:05 AM
What is wrong in this Sub? Michael[_27_] Excel Programming 3 August 18th 04 06:46 PM
What do i wrong here kkknie[_182_] Excel Programming 0 August 11th 04 08:41 PM
Anybody see anything wrong with this Dthmtlgod Excel Programming 1 April 20th 04 03:16 PM


All times are GMT +1. The time now is 09:17 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"