+ Reply to Thread
Results 1 to 2 of 2

Consolidation of vba programming and dynamic update

  1. #1
    Registered User
    Join Date
    07-30-2012
    Location
    Shippensburg, PA
    MS-Off Ver
    office 2007, Frontpage and Visio 2003
    Posts
    22

    Question Consolidation of vba programming and dynamic update

    I want to consolidate my many lines of code and also if I have to move or change a column that the move changes the cell reference.

    I have the current list of 56 rooms:
    WAIT
    A-2
    A-3
    A-4
    A-5
    A-6
    A-7
    A-8
    A-9
    A-10
    A-21
    A-2H
    A-3H
    A-4H
    A-5H
    A-6H
    A-7H
    A-8H
    A-9H
    A-10H
    B-1
    B-11
    B-12
    B-14
    B-15
    B-16
    B-17
    B-18
    B-19
    B-20
    B-1H DESK
    B-1H TREE
    B-11H
    B-12H
    B-14H
    B-15H
    B-16H
    B-17H
    B-17H LAMP
    B-20H
    C-22
    C-23
    C-24
    C-25
    C-26
    C-27
    C-28
    C-29
    C-30
    C-31
    C-22H
    C-23H
    C-24H
    C-25H
    C-26H
    C-27H
    OOD

    I have 2 active x check boxes assigned to each room, one for an out time and one for an in time.
    This means, I have 2 Private Sub Click subroutines for each room totaling 112.
    How do I just make a list of rooms in 1 subroutine that will go down that list and reference each room for the in and out?
    See code below.

    Please Login or Register  to view this content.
    I want to replace A10OUT and A10IN with a variable to reference the room list so I can get rid of the 36 lines of code per room, and I also need to change the reference to the Row Q from 3 to 59 as it goes thru the room list
    The references to Row Q need to be dynamic so that if I move the row or add a row, it could change it automatically.

    I forgot, there is a identical column next to it for Time IN.
    So, the same questions apply for the S column and the appropriate row.

    Please Login or Register  to view this content.
    I am a newbie and this is as much code as I know.

    Thanks in advance,

    Christopher aka Ferrum
    Last edited by ferrum_equitis; 11-29-2012 at 09:23 AM.

  2. #2
    Registered User
    Join Date
    07-30-2012
    Location
    Shippensburg, PA
    MS-Off Ver
    office 2007, Frontpage and Visio 2003
    Posts
    22

    Lightbulb Re: Consolidation of vba programming and dynamic update

    I don't know how to to the code but what if we had the list in a worksheet in the workbook named "DATA" A3:A59 which contain the room names. Could we...


    Please Login or Register  to view this content.
    then keep repeating starting over at A3

    This will save me about 700 lines of code.

    Thanks in advance

    Christopher aka Ferrum
    Last edited by ferrum_equitis; 12-03-2012 at 01:38 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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