Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Syntax To Insert A Number Into One TrxtBox If A Different TextBox Has A Date That Is = 1/1/98

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Syntax To Insert A Number Into One TrxtBox If A Different TextBox Has A Date That Is = 1/1/98


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Syntax To Insert A Number Into One TrxtBox If A Different TextBox Has A Date That Is = 1/1/98

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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Syntax To Insert A Number Into One TrxtBox If A Different TextBox Has A Date That Is = 1/1/98 - SOLVED

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



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default Syntax To Insert A Number Into One TrxtBox If A Different TextBox Has A Date That Is = 1/1/98 - Solved

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 =


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
Textbox value insert in two cells kk Excel Discussion (Misc queries) 11 March 17th 08 11:26 PM
Syntax for selecting a textbox within a chart? tenlbham Charts and Charting in Excel 4 April 25th 07 02:39 AM
Insert spreadsheet in Excel textbox or comment box w1morecast Excel Discussion (Misc queries) 0 October 18th 05 06:51 PM
Insert more than 1 Row Syntax blazzae Excel Worksheet Functions 5 July 10th 05 12:46 AM
Help with Syntax UserForm TextBox John Wilson Excel Programming 1 July 28th 03 04:15 PM


All times are GMT +1. The time now is 07:34 AM.

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

About Us

"It's about Microsoft Excel"