Posts by max_lux

    Re: Change Sheet TAB Color


    Ok this works for me and should work for you too. It's the same code for xp and 2003. When you select a new sheet, it colours the one you just left (previous).


    Code
    Private Sub Worksheet_Deactivate()
    ActiveWorkbook.ActiveSheet.Previous.Tab.ColorIndex = 3
    End Sub

    Re: Detect if F1 pressed on a userform


    or assign a "Help" Button to the sheet


    Code
    Private Sub cbHelp_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
        If KeyCode = vbKeyF1 Then
            'your code here
        End If
    End Sub


    ... something along those lines


    or just had

    Code
    If KeyCode = vbKeyF1 Then
            'your code here
        End If


    in mouseover for all the ojects on the form.


    Also, to disable F1 I would assign onkey at workbook open

    Code
    Application Onkey ("F1"), ""


    and on workbook close enable it again

    Code
    Application Onkey ("F1")

    Re: copy last cell on sheet and populate txtbox


    if you add this you don't need the button:


    Code
    Private Sub UserForm_Initialize()
    txtFlashingWidth = Worksheets("sheetwidth").Range("a2").End(xlUp).Offset(1, 0)
    Label32.Visible = True
    txtFlashingWidth.Visible = True
    Label33.Visible = True
    txtFlashingLength.Visible = True
    End Sub


    Im working on why the end up doens't work...

    I am running a userform with protect/ unprotect commandbuttons alternately visable and enabled. Since I can protect or unprotect the workbook from the userform, and can unload the userform in either state, I would like to check on userform init whether the workbook is protected or not, so I can have the applicable button visible/enabled.


    Is this possible?



    Thanks in advance!

    Re: Combobox repeating options


    ok i think this might be it - try this - because you are essentially - reloading it rather than initializing it, it will still contain the previous values. unloading and initializing it should reset the values



    Code
    Private Sub CmdClear_Click() 
    
    
        Unload Userform
        Call UserForm_Initialize 
         
    End Sub

    Re: Combobox repeating options


    Sorry m8, I just hate seeing people being "classified"


    As far as I am concerned, there are only two classifications for people:


    Living
    Deceased



    now, to code :)
    sorry, I can't see a reason your code triples the values. You seem to be clearing it properly on init. I will continue to see if I can figure it out...

    Re: Saving over VPN


    This is the code i use at workbook open


    i assgn the variable via a form the user selects time and program to use, but you could simplify it by doing that for them


    in my workbook_open code


    Here is ontime code for a specific time


    Code
    Application.OnTime TimeValue("00:00:00"), "Sub_Name" ' (HH:MM:SS)