Results 1 to 2 of 2

Thread: VBA Questions

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2000
    Posts
    32

    Question

    I have two questions...both of them are in VBA

    1) Is there a way i can embed a combo box directly in the cell. so it the combobox is exactly the same size as the cell it needs to go in.

    2) the other quesiton is, since i can't use control arrays in VBA (at least i don't think so) is there an easy way to reference around 30 combo boxes.

    IF yes, can i get an example.

    thanks!

  2. #2
    Fanatic Member
    Join Date
    Oct 1999
    Location
    England
    Posts
    982

    Wink

    Don't know about the first question but with the second question you could use the 'For Each...Next' loop to enumerate through the controls.

    Code:
    dim ctl as control
    
    for each ctl in form1.controls
       if TypeOf  ctl is ComboBox then
          ...
          do something
          ...
       endif
    next

    I am not at work at the moment and am without my vb so you will have to check on the syntax.



    Things I do when I am bored: DotNetable

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width