updated textbox info hidden under old

Markus_87

New Member
Joined
Mar 29, 2011
Messages
12
Hi guys,

Using the code beneath to set a datepicker to show the current date and update a textbox which is linked to it, however the previous date that was in the textbox is staying visible and the new date is underneath it. I.e you have to delete the old date out before the new date is visible. I've seen this code before unbound_ctrl_Date = DTPicker1.Value but not sure how to incorporate it.

Private Sub Workbook_Open()
Dim objOLE As Object
For Each objOLE In Sheets("Theatres Checklist").OLEObjects
If TypeName(objOLE.Object) = "DTPicker" Then
objOLE.Object.Value = Date
End If
Next objOLE


Dim objOL As Object
For Each objOL In Sheets("Theatres Checklist").OLEObjects
If TypeName(objOL.Object) = "TextBox28" Then
objOL.Object.Value = DTPicker1

End If
Next objOL

End Sub

Thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top