Edit ActiveX textbox from VBA Userform

Instigator

New Member
Joined
Aug 9, 2016
Messages
10
The formatting for my original post messed up. I have corrected it below.

I have a userform that adds, edits, and delete deletes entries from a sheet named ‘Data’ (Sheet 2). The first row of this dataset feeds into the 2 ActiveX textboxes that I have on Sheet(1). Upon adding an entry, I would like to ‘refresh’ the data in the ActiveX textboxes to reflect this data with these updated values.

I am able to set values of the ActiveX textboxes with the Workbook_Open function. This works successfully.

However, I am unable to incorporate it into a userform.The ActiveX textboxes are named “txtDate” and “txtRemarks”The corresponding data for “txtDate” is in sheet ‘Data’ cell B3;The corresponding data for “txtRemarks” is in sheet ‘Data’ cell C3

How do I dim/call the ActiveX textboxes within a VBA userform in order to set the values?

cross-thread
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
This work for me on a userform

Code:
Private Sub CommandButton1_Click()
    Sheets("Sheet1").txtDate.Value = Sheets("Data").Range("B3").Value
    Sheets("Sheet1").txtRemarks.Value = Sheets("Data").Range("C3").Value
End Sub
 
Upvote 0
This work for me on a userform

Code:
Private Sub CommandButton1_Click()
    Sheets("Sheet1").txtDate.Value = Sheets("Data").Range("B3").Value
    Sheets("Sheet1").txtRemarks.Value = Sheets("Data").Range("C3").Value
End Sub

Dante,

Yep, I'm just an idiot. Thank you. Your solution works great!
 
Upvote 0
Do'not worry, it happens to all of us. I'm glad to help you. Thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,037
Members
449,062
Latest member
mike575

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