LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default How do I create a button to reset ComboBoxs

You don't have to select that range to clearcontents.

Range("B26:C26,B3:B6,C3,C17:C20").ClearContents
Range("B4").Select
Range("B4").Activate

And I'm not sure what the .activate does that .select didn't. (I'd either drop
the last line or the last two lines--why change the selection from what the user
already had???)




noirnor wrote:

Just to show you what I have now.

Sub Reset()

Dim OLEObj As OLEObject
For Each OLEObj In Worksheets("Spec").OLEObjects
Worksheets("Data").OLEObjects
If TypeOf OLEObj.Object Is MSForms.ComboBox Then
OLEObj.Object.ListIndex = 0
End If

Next OLEObj
For Each OLEObj In Worksheets("Spec").OLEObjects
If TypeOf OLEObj.Object Is MSForms.TextBox Then
OLEObj.Object.Text = Clear
End If
Next OLEObj

Range("B26:C26,B3:B6,C3,C17:C20").Select
Selection.ClearContents
Range("B4").Select
Range("B4").Activate
End Sub


--

Dave Peterson

 
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
RESET BUTTON CandiC Excel Worksheet Functions 2 November 2nd 09 10:19 PM
How do I create a "Reset Data" Button for a Worksheet? Billy Excel Worksheet Functions 3 December 15th 08 09:29 PM
Reset Button Raz Excel Worksheet Functions 3 November 26th 08 11:32 PM
Reset Button Raz Excel Worksheet Functions 4 November 26th 08 05:26 PM
Reset Button trilogy Excel Discussion (Misc queries) 0 July 27th 06 03:36 AM


All times are GMT +1. The time now is 02:06 PM.

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

About Us

"It's about Microsoft Excel"