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

I cannot find a way to clear the contents of an
ActiveX textbox.
Here is what I would like to say:

Sub ClearTextbox()
Dim oleObj As OLEObject

For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
If oleObj.Name = "Control 1" Then
With oleObj
'clear the contents
End With
End If
End If
Next

Would appreciate help, please.

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.718 / Virus Database: 474 - Release Date: 09/07/2004


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Clear a textbox

Sub ClearTextbox()
Dim oleObj As OLEObject

For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
If oleObj.Name = "Control 1" Then
With oleObj
.Object.Value = ""
End With
End If
End If
Next


or just

ActiveWorkbook.Sheets("Contract Master Order") -
.OLEObjects("Control 1").Object.Value = ""


--
Regards,
Tom Ogilvy

"Stuart" wrote in message
...
I cannot find a way to clear the contents of an
ActiveX textbox.
Here is what I would like to say:

Sub ClearTextbox()
Dim oleObj As OLEObject

For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
If oleObj.Name = "Control 1" Then
With oleObj
'clear the contents
End With
End If
End If
Next

Would appreciate help, please.

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.718 / Virus Database: 474 - Release Date: 09/07/2004




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 413
Default Clear a textbox

Value!
Thanks again.

Regards.

"Tom Ogilvy" wrote in message
...
Sub ClearTextbox()
Dim oleObj As OLEObject

For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
If oleObj.Name = "Control 1" Then
With oleObj
.Object.Value = ""
End With
End If
End If
Next


or just

ActiveWorkbook.Sheets("Contract Master Order") -
.OLEObjects("Control 1").Object.Value = ""


--
Regards,
Tom Ogilvy

"Stuart" wrote in message
...
I cannot find a way to clear the contents of an
ActiveX textbox.
Here is what I would like to say:

Sub ClearTextbox()
Dim oleObj As OLEObject

For Each oleObj In ActiveWorkbook.Sheets _
("Contract Master Order").OLEObjects
If TypeOf oleObj.Object Is MSForms.TextBox Then
If oleObj.Name = "Control 1" Then
With oleObj
'clear the contents
End With
End If
End If
Next

Would appreciate help, please.

Regards.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.718 / Virus Database: 474 - Release Date: 09/07/2004






---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.718 / Virus Database: 474 - Release Date: 09/07/2004


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
Transfer a name from one cell to another but leave clear if clear? Scoober Excel Worksheet Functions 3 May 22nd 09 02:55 AM
TextBox will not clear date??????????? Tdp Excel Discussion (Misc queries) 4 January 12th 09 03:21 PM
clear the clear the web page email attachment lines MCrider Excel Discussion (Misc queries) 0 November 11th 07 10:05 PM
clear textbox contents dirt Excel Programming 1 January 27th 04 04:25 AM
UserForm TextBox to ActiveSheet TextBox over 256 characters Dan E[_2_] Excel Programming 1 July 28th 03 07:36 PM


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