Results 1 to 5 of 5

help with making vba code smaller

Threaded View

  1. #1
    Registered User
    Join Date
    11-16-2016
    Location
    Rochester, NY
    MS-Off Ver
    2013
    Posts
    3

    help with making vba code smaller

    I have the following code that I would like to make smaller perhaps by looping through. I tried doing a do while statement (cos < 6) but I couldn't figure out how to do the variable for the "cos_button_1.value". the "cos_button_"s are activeX option buttons.

    I would greatly appreciate any assistance.


    Dim cos As Integer
               cos = 1
                If cos_button_1.Value = True Then
                    Call foo(cos)
                End If
                cos = cos + 1
                If cos_button_2.Value = True Then
                    Call foo(cos)
                End If
                cos = cos + 1
                If cos_button_3.Value = True Then
                    Call foo(cos)
                End If
                cos = cos + 1
                If cos_button_4.Value = True Then
                    Call foo(cos)
                End If
                cos = cos + 1
                If cos_button_5.Value = True Then
                    Call foo(cos)
                End If
    Last edited by vendetta907; 11-17-2016 at 02:48 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Workbook opens smaller after making userform
    By bishoposiris in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-10-2016, 11:39 AM
  2. Does Anyone have tips for making a spreadsheet smaller?
    By ExcelDavid in forum Excel General
    Replies: 2
    Last Post: 03-28-2014, 04:13 PM
  3. Making a file smaller
    By mlbdc2012 in forum Excel General
    Replies: 6
    Last Post: 03-05-2014, 10:19 AM
  4. Making files smaller
    By mikesimpson in forum Excel General
    Replies: 2
    Last Post: 12-28-2011, 01:11 PM
  5. Making this code smaller
    By roberto1111 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-07-2009, 03:38 PM
  6. Making file size smaller
    By mrdata in forum Excel General
    Replies: 1
    Last Post: 04-18-2008, 05:58 PM
  7. Making Tab Sizes smaller or creating multiple rows of tabs.
    By kingbiscuit in forum Excel General
    Replies: 4
    Last Post: 03-05-2008, 04:44 PM

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