JackReacher85
Banned user
- Joined
- Sep 14, 2021
- Messages
- 12
- Office Version
- 2016
- Platform
- Windows
Hi guys,
Imlooking to create a clear button within an excel worksheet, i need the below vba to be combined to allow it to clear cells and an ActiveX textbox, heres the VBA i have thus far
Appreciate any help you can offer on this one
Imlooking to create a clear button within an excel worksheet, i need the below vba to be combined to allow it to clear cells and an ActiveX textbox, heres the VBA i have thus far
VBA Code:
Sub Clr()
'
' Clr Macro
'
'
Range("C7:E8").Select
Selection.ClearContents
Range("G7:I8").Select
Selection.ClearContents
Range("C12").Select
Selection.ClearContents
Range("F12").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=18
Range("C25").Select
Selection.ClearContents
Range("C26").Select
Selection.ClearContents
Range("C27").Select
Selection.ClearContents
ActiveWindow.SmallScroll Down:=-36
Range("C7:E8").Select
End Sub
VBA Code:
Sub Clear_TextBox()
Dim tbx As OLEObject
For Each tbx In ActiveSheet.OLEObjects
If TypeName(tbx.Object) = "TextBox" Then
tbx.Object.Text = ""
End If
Next
End Sub
Appreciate any help you can offer on this one