Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
loulou
 
Posts: n/a
Default Am I asking too much of my macro's

I am using a spread sheet which contains a number of combi boxes (approx. 30)
Once I've selected all requirments in these combi boxes, I run a macro to
copy the selections to another sheet. I then need all the combi boxes to
return to their previous/original selections, ready to start the process
again.
I tried to record a macro to return them all to their original selections
but its not recording any of my 30 selections. It takes far to long doing
this manually each time. Thanks for any suggestions
  #2   Report Post  
Tom Ogilvy
 
Posts: n/a
Default

Control Toolbox Toolbar Combobox:

Dim obj as OleObject
for each obj on Activesheet.OleObjects
if type of obj.Object is MSForms.combobox then
obj.Object.ListIndex = -1
end if
next


Forms toolbar DropDown Box:

Dim dBox as DropDown
for each dbox in Activesheet.Dropdowns
dbox.Index = 0
Next

If they 're data validation dropdowns, then clearcontents on the cell.

--
Regards,
Tom Ogilvy

"loulou" wrote in message
...
I am using a spread sheet which contains a number of combi boxes (approx.

30)
Once I've selected all requirments in these combi boxes, I run a macro to
copy the selections to another sheet. I then need all the combi boxes to
return to their previous/original selections, ready to start the process
again.
I tried to record a macro to return them all to their original selections
but its not recording any of my 30 selections. It takes far to long doing
this manually each time. Thanks for any suggestions



  #3   Report Post  
Dave Peterson
 
Posts: n/a
Default

Typo alert!

Dim dBox As DropDown
For Each dBox In ActiveSheet.DropDowns
dBox.ListIndex = 0
Next

..index replaced with .listindex



Tom Ogilvy wrote:

Control Toolbox Toolbar Combobox:

Dim obj as OleObject
for each obj on Activesheet.OleObjects
if type of obj.Object is MSForms.combobox then
obj.Object.ListIndex = -1
end if
next

Forms toolbar DropDown Box:

Dim dBox as DropDown
for each dbox in Activesheet.Dropdowns
dbox.Index = 0
Next

If they 're data validation dropdowns, then clearcontents on the cell.

--
Regards,
Tom Ogilvy

"loulou" wrote in message
...
I am using a spread sheet which contains a number of combi boxes (approx.

30)
Once I've selected all requirments in these combi boxes, I run a macro to
copy the selections to another sheet. I then need all the combi boxes to
return to their previous/original selections, ready to start the process
again.
I tried to record a macro to return them all to their original selections
but its not recording any of my 30 selections. It takes far to long doing
this manually each time. Thanks for any suggestions


--

Dave Peterson
  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

And another <vbg:

Dim obj As OLEObject
For Each obj In ActiveSheet.OLEObjects
If TypeOf obj.Object Is MSForms.combobox Then
obj.Object.ListIndex = -1
End If
Next

TypeOf (one word)
"In" instead of "On" in the "For each" line.

Tom Ogilvy wrote:

Control Toolbox Toolbar Combobox:

Dim obj as OleObject
for each obj on Activesheet.OleObjects
if type of obj.Object is MSForms.combobox then
obj.Object.ListIndex = -1
end if
next

Forms toolbar DropDown Box:

Dim dBox as DropDown
for each dbox in Activesheet.Dropdowns
dbox.Index = 0
Next

If they 're data validation dropdowns, then clearcontents on the cell.

--
Regards,
Tom Ogilvy

"loulou" wrote in message
...
I am using a spread sheet which contains a number of combi boxes (approx.

30)
Once I've selected all requirments in these combi boxes, I run a macro to
copy the selections to another sheet. I then need all the combi boxes to
return to their previous/original selections, ready to start the process
again.
I tried to record a macro to return them all to their original selections
but its not recording any of my 30 selections. It takes far to long doing
this manually each time. Thanks for any suggestions


--

Dave Peterson
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
Enabling macros Peter M Excel Discussion (Misc queries) 3 February 7th 05 10:57 PM
sorting with macros Sorting in macros Excel Discussion (Misc queries) 1 February 1st 05 09:02 AM
Transferring toolbars and macros to other computers Darrell Excel Discussion (Misc queries) 1 January 19th 05 12:21 AM
The available macros list in XL; how to suppress filename from showing KR Excel Discussion (Misc queries) 1 January 10th 05 07:20 PM
Macros disappear after a file is imported Brent E Excel Discussion (Misc queries) 1 December 18th 04 12:25 AM


All times are GMT +1. The time now is 12:17 PM.

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"