Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default textbox Do nothing

Hi, i am trying to use a textbox on a userform. I would like the code below
to do nothing if the textbox value is empty.

I can use this code
ActiveCell.Offset(0, 8) = TextBox8.Value
but I need the textbox not to perform a function if the textbox is empty.
This is because the cell that the textbox is writing to contains a Sum. I
only want this Sum over writing with the textbox value if the textbox
contains a value.
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default textbox Do nothing

Hi,

Enclose it in an IF statement

If TextBox8.Value < "" Then
ActiveCell.Offset(0, 8) = TextBox8.Value
Else
'maybe do something else
End If

Mike

"Woodi2" wrote:

Hi, i am trying to use a textbox on a userform. I would like the code below
to do nothing if the textbox value is empty.

I can use this code
ActiveCell.Offset(0, 8) = TextBox8.Value
but I need the textbox not to perform a function if the textbox is empty.
This is because the cell that the textbox is writing to contains a Sum. I
only want this Sum over writing with the textbox value if the textbox
contains a value.
Thanks

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 from 1st worksheet to textbox to other multiple sheets LRay67 Excel Programming 2 March 18th 08 02:20 PM
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys Minitman[_4_] Excel Programming 0 February 22nd 05 08:50 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:47 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:43 PM
How to move cursor from one textbox control to another textbox con KMoore007 Excel Programming 0 September 16th 04 02:47 PM


All times are GMT +1. The time now is 06:18 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"