Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings,
In an Exit event I need to see if the date value in TextBox1 is = 9/15/1998. If yes, then the value in TextBox 7 needs to be .0825. If not, the value in TextBox7 needs to be.08. I tried this: If TextBox1.Value = "9/15/1998" Then TextBox7.Value = "8.25%" Else: TextBox7.Value = "8%" End If But it only returns .0825 in TextBos7, no matter what the date is in TextBox1. What am I doing wrong? Can anyone help me? TIA -Minitman |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() The code works correctly with me. maybe instead of = you should put -- mangesh_yada ----------------------------------------------------------------------- mangesh_yadav's Profile: http://www.excelforum.com/member.php...fo&userid=1047 View this thread: http://www.excelforum.com/showthread.php?threadid=27761 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Mangesh,
Thanks for the reply. I do appreciate it. Changing the order (= to =) was part of the solution. The other part was dimming the date as date. I forgot to mention that I am running Excel 2003 on a Win 2k box. This may also have been a factor. -Minitman On Fri, 12 Nov 2004 00:02:31 -0600, mangesh_yadav wrote: The code works correctly with me. maybe instead of = you should put = |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Minitman,
try this: Dim date1 As Date date1 = TextBox1.Value If date1 = "9/15/1998" Then TextBox2.Value = "8.25%" Else TextBox2.Value = "8%" End If -Erik "Minitman" wrote in message ... Greetings, In an Exit event I need to see if the date value in TextBox1 is = 9/15/1998. If yes, then the value in TextBox 7 needs to be .0825. If not, the value in TextBox7 needs to be.08. I tried this: If TextBox1.Value = "9/15/1998" Then TextBox7.Value = "8.25%" Else: TextBox7.Value = "8%" End If But it only returns .0825 in TextBos7, no matter what the date is in TextBox1. What am I doing wrong? Can anyone help me? TIA -Minitman |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey Erik,
That was the answer - I did not have TextBox1 Dimmed as a date. Thank you, this now works. -Minitman On Thu, 11 Nov 2004 22:17:31 -0800, "E Oveson" wrote: Hey Minitman, try this: Dim date1 As Date date1 = TextBox1.Value If date1 = "9/15/1998" Then TextBox2.Value = "8.25%" Else TextBox2.Value = "8%" End If -Erik "Minitman" wrote in message .. . Greetings, In an Exit event I need to see if the date value in TextBox1 is = 9/15/1998. If yes, then the value in TextBox 7 needs to be .0825. If not, the value in TextBox7 needs to be.08. I tried this: If TextBox1.Value = "9/15/1998" Then TextBox7.Value = "8.25%" Else: TextBox7.Value = "8%" End If But it only returns .0825 in TextBos7, no matter what the date is in TextBox1. What am I doing wrong? Can anyone help me? TIA -Minitman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Textbox value insert in two cells | Excel Discussion (Misc queries) | |||
Syntax for selecting a textbox within a chart? | Charts and Charting in Excel | |||
Insert spreadsheet in Excel textbox or comment box | Excel Discussion (Misc queries) | |||
Insert more than 1 Row Syntax | Excel Worksheet Functions | |||
Help with Syntax UserForm TextBox | Excel Programming |