+ Reply to Thread
Results 1 to 2 of 2

How to use, if possible, CallByName for frames within a userform

  1. #1
    Registered User
    Join Date
    03-17-2020
    Location
    Winterswijk
    MS-Off Ver
    2013
    Posts
    7

    Question How to use, if possible, CallByName for frames within a userform

    I Found a simple programming for userforms to show depending on their Name, I would like to use the same idea for frames within a userform but I cannot figure out how.

    This is what I found for the userform and it works fine.

    Option Explicit

    Function Form(Name As String) As Object
    Set Form = CallByName(UserForms, "Add", VbMethod, Name)
    End Function

    Sub Test()
    Dim strFormName As String
    strFormName = "Userform" ' <-- replace by your lookup code instead
    Form(strFormName).Visible = True

    End Sub

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: How to use, if possible, CallByName for frames within a userform

    Why do you need callbyname at all when you can just use userforms.add "formname"? You can also refer to controls on a form by name using the Controls collection, so you don't need callbyname for that either.
    Rory

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] How can I link frames dynamically in a userform?
    By chunkyp in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-09-2017, 07:45 AM
  2. Creating and displaying 16 frames on a userform each frame two labels.
    By josaah in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-20-2016, 10:56 AM
  3. [SOLVED] UserForm Frames
    By wambaugh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-08-2015, 06:40 PM
  4. [SOLVED] add 2 more frames to existing UserForm VBA to populate textboxes
    By chriswhite1982 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-05-2014, 05:47 PM
  5. callbyname in XL 2K and XL 2003
    By Doug Glancy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-14-2005, 02:45 AM
  6. [SOLVED] Multiple Frames on a userform
    By James McDowell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-03-2005, 01:06 AM
  7. Multiple Frames in One UserForm
    By bforster1 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-26-2005, 03:19 PM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1