Clear macro help needed

Captain_Context

New Member
Joined
Feb 8, 2011
Messages
5
OK I have a ridiculously simple question that has been plaguing me for a while.
I'm trying to get the hand of using Activex controls but keep encountering strange problems like this...

I have a form that I have made which has 2 activex combo boxes with information to select and then 2 activex text boxes which allow for 2 data entry points (which I then am spread sheeting the entered information - allow that is not important right yet).

I have to Button controls (tried one as a an activex button, and the other as a picture inserted - neither work with what I am trying to do) One is to press "enter" and a macro copies the data into a spreadsheet and the other is to "clear the data" that I have entered into the combo and text boxes.

For some reason, when I try to make a macro to "clear" these lists/boxes - nothing happens.

I start recording (I have to be on a cell before it will start, not on a text box) I select all in the box and delete, and do the same thing for the next text box (then I have to select a cell to not be in the text box), and then stop the macro.

I assign the macro to either the button or the object (neither one worked) and repopulate the text boxes and try the clear macro - but the text boxes go untouched, the only thing that changes is that the box I clicked off on to end the macro becomes selected.

what am I doing wrong (besides trying to figure excel out on my own :P )
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
below is an example of how your clear and populate a listbox - by clicking the CommandButton1 - the code world be in the userform portion - just double click you CommandButton1 in design mode. If this is too simplistic - then post your code that gives the problem.

Code:
Private Sub CommandButton1_Click()
    With ListBox1
        .Clear
        .AddItem "Entry one"
        .AddItem "Entry two"
        .AddItem "Entry three"
    End With
End Sub
 
Upvote 0
I'm very sorry, but I don't know anything about code, how to code or anything. It is to complicated. I've only ever used the regular excel worksheet in order to get things done.

The very simplest explanation of how to get a button or object that I can link to a recorder macro to clear 1 activex text box would work, and then I could go from there maybe.

I find it strange that I never have these problems with recording macros in excel 2003 or even 2007 - it just seems to have happened with the activex textbox, is there something that must be enabled or disabled for the macro to work with the activex stuff?

I have enable macros and activex on in the trust centre

thanx
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,833
Members
452,947
Latest member
Gerry_F

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