Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default UserForm TextBoxes (with ControlSource set) won't clear in one click

Hi all

I have a UserForm with various controls (textboxes, listbox,
checkboxes, etc) that I wish to clear with one button, and populate
with default values with another button.

This all works fine ONLY IF the textboxes do not have their
ControlSource property set. When the textbox have a ControlSource
property set, clicking a button will work for only one control at a
time. In other words, if there's 6 controls to either clear or
populate, it takes 6 clicks to work.

I've not been able to find any solution on the newsgroups, nor on
Microsoft's Knowledge Base. Does anyone else know of this issue, and
perhaps a solution? I'm using Excel XP but it's the same on Excel
2000.

Regards

Paul Martin
Melbourne, Australia
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default UserForm TextBoxes (with ControlSource set) won't clear in one click

There is no issue. If the ControlSource property is set, they pick up the
value from that cell.

You could just clear the cells in that one button action, the textboxes will
fall in line.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Paul Martin" wrote in message
om...
Hi all

I have a UserForm with various controls (textboxes, listbox,
checkboxes, etc) that I wish to clear with one button, and populate
with default values with another button.

This all works fine ONLY IF the textboxes do not have their
ControlSource property set. When the textbox have a ControlSource
property set, clicking a button will work for only one control at a
time. In other words, if there's 6 controls to either clear or
populate, it takes 6 clicks to work.

I've not been able to find any solution on the newsgroups, nor on
Microsoft's Knowledge Base. Does anyone else know of this issue, and
perhaps a solution? I'm using Excel XP but it's the same on Excel
2000.

Regards

Paul Martin
Melbourne, Australia



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default UserForm TextBoxes (with ControlSource set) won't clear in one click

Thanks Bob

I've got it working by using Range("ClearCells").ClearContents for the
cells that are linked to textboxes, and
Range("Checkboxes").Cells.Value = False for the cells that are linked
to checkboxes.

Regards

Paul


"Bob Phillips" wrote in message ...
There is no issue. If the ControlSource property is set, they pick up the
value from that cell.

You could just clear the cells in that one button action, the textboxes will
fall in line.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Paul Martin" wrote in message
om...
Hi all

I have a UserForm with various controls (textboxes, listbox,
checkboxes, etc) that I wish to clear with one button, and populate
with default values with another button.

This all works fine ONLY IF the textboxes do not have their
ControlSource property set. When the textbox have a ControlSource
property set, clicking a button will work for only one control at a
time. In other words, if there's 6 controls to either clear or
populate, it takes 6 clicks to work.

I've not been able to find any solution on the newsgroups, nor on
Microsoft's Knowledge Base. Does anyone else know of this issue, and
perhaps a solution? I'm using Excel XP but it's the same on Excel
2000.

Regards

Paul Martin
Melbourne, Australia

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Clear Comboboxes & Textboxes MBlake New Users to Excel 3 May 2nd 05 10:29 PM
Change UserForm ControlSource with VBA [email protected] Excel Discussion (Misc queries) 2 February 24th 05 08:05 AM
ControlSource in a userform textbox Ian Mangelsdorf Excel Programming 1 October 18th 04 01:17 PM
Clear Textboxes, Labels, and Checkboxes milo[_2_] Excel Programming 1 October 16th 03 09:21 PM
Basic Userform Controlsource question Kevin Excel Programming 0 August 7th 03 11:04 PM


All times are GMT +1. The time now is 11:29 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"