Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clearing a value from a TextBox Automatically??


Hi all, i have put together some code to delete 3 items of data
dependent on Textbox1 value....It works fine only, i can not get
Textbox1 to clear the value or text in it after deletion,

Any ideas?
Here's the code

Regards,
Simon

Dim mycell
Dim rng As Range
Worksheets("Stats12").Visible = True
Set rng = Range("Statlist")
For Each mycell In rng
If mycell.Value = Worksheets("New stats").TextBox1.Value Then
mycell.Value = ""
mycell.Offset(0, 1) = ""
mycell.Offset(0, 2) = ""
Call playersort
Worksheets("New stats").Select
Worksheets("Stats12").Visible = False
End If
Next
With Worksheets("New Stats")
Worksheets("New Stats").Select
TextBox1 = ""
End With
End Sub


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=547614

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clearing a value from a TextBox Automatically??


Hi all, Below is some code i use to delete some data, and i have no
worked out clearing the Textbox, but i have one other problem, when th
search takes place if the user hasn't typed the text or value to loo
for in the case in which it was typed it finds nothing how can i mak
it so that the case doesn't matter?

Regards,
Simon

Dim mycell
Dim rng As Range
Worksheets("Stats12").Visible = True
Set rng = Range("Statlist")
For Each mycell In rng
If mycell.Value = Worksheets("New stats").TextBox1.Value Then
mycell.Value = ""
mycell.Offset(0, 1) = ""
mycell.Offset(0, 2) = ""
Call playersort
Worksheets("New stats").Select
Worksheets("Stats12").Visible = False
End If
Next
Call tboxClear
End Sub

Sub tboxClear()
With Worksheets("New Stats")
Worksheets("New Stats").Select
If Range("A99").Value = "" Then
Worksheets("New Stats").TextBox1.Value = ""

End If
End With
End Su

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=54761

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Clearing a value from a TextBox Automatically??

if trim(Worksheets("New stats").TextBox1.Value) = "" Then
exit sub
end if

If lcase(mycell.Value) = lcase(Worksheets("New stats").TextBox1.Value) Then
....



Simon Lloyd wrote:

Hi all, Below is some code i use to delete some data, and i have now
worked out clearing the Textbox, but i have one other problem, when the
search takes place if the user hasn't typed the text or value to look
for in the case in which it was typed it finds nothing how can i make
it so that the case doesn't matter?

Regards,
Simon

Dim mycell
Dim rng As Range
Worksheets("Stats12").Visible = True
Set rng = Range("Statlist")
For Each mycell In rng
If mycell.Value = Worksheets("New stats").TextBox1.Value Then
mycell.Value = ""
mycell.Offset(0, 1) = ""
mycell.Offset(0, 2) = ""
Call playersort
Worksheets("New stats").Select
Worksheets("Stats12").Visible = False
End If
Next
Call tboxClear
End Sub

Sub tboxClear()
With Worksheets("New Stats")
Worksheets("New Stats").Select
If Range("A99").Value = "" Then
Worksheets("New Stats").TextBox1.Value = ""

End If
End With
End Sub

--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=547614


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Clearing a value from a TextBox Automatically??


Once again thanks Dave!
Regards,
Simon


--
Simon Lloyd
------------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...fo&userid=6708
View this thread: http://www.excelforum.com/showthread...hreadid=547614

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
how do I enter cell value automatically to textbox? Fadzil Excel Discussion (Misc queries) 2 July 3rd 08 04:36 AM
Clearing a textbox in userform excelnut1954 Excel Programming 2 April 14th 06 08:27 PM
Excel Automatically Clearing The Clipboard MDW Excel Programming 3 February 10th 06 07:28 PM
How to make scrollbar disappear after clearing textbox? RB Smissaert Excel Programming 1 November 6th 05 11:08 AM
Clearing cell contents automatically Tom Ogilvy Excel Programming 2 August 21st 03 04:07 AM


All times are GMT +1. The time now is 01:35 PM.

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"