Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
RESET BUTTON | Excel Worksheet Functions | |||
How do I create a "Reset Data" Button for a Worksheet? | Excel Worksheet Functions | |||
Reset Button | Excel Worksheet Functions | |||
Reset Button | Excel Worksheet Functions | |||
Reset Button | Excel Discussion (Misc queries) |