Posts by abbeville

    Good Afternoon
    I have the following formula in cell I3:
    =(IF(OR(E3=(A47*F3),E3=(A47*F3)-1,E3=(A47*F3)-2),(IF(AND(H3>0,I26<3),1,0))))
    I'm looking for a result of '0' but it comes up with 'FALSE'.
    E3=6,A47=5,F3=1,H3=4,I26=0
    If I change E3 to '5', I get a result of '1' as I should.
    This is half of the final formula. There will be another half which will give a result of '2'.
    If I can get the first half working properly, I should be able to add the second half.
    Thank You
    abbeville

    Good Morning
    I have a DTPicker on a multipage form on a userform with the following codes:

    Code
    sheet1.range("Ac2").value=DTPicker1.value


    Code
    DTPicker1.value=sheet1.range("AC2").value


    The first line of code is in the DTPicker1_change event.
    The second line of code is in the userform_initialize event.
    This works fine if I move the DTPicker control onto the userform itself, but if I put the control on the multipage form it fails with the following message:
    Run Time Error 35788
    An error occurred in a call to the Windows date & time picker control.
    Please advise
    abbeville

    Re: Decrease Cell Value


    Thanks IanDunnet. I changed your code to the following & it appears to work. The code you sent me didn't work at all. I tried a few combinations to no avail until I tried this.

    Code
    Private Sub TextBox1_AfterUpdate() 
         
        Userform2.Combobox41.Value = Userform2.Combobox41.value- 1 
         
    End Sub


    Thanks again for putting me on the right track.
    abbeville

    Good Morning. Is there a formula or maybe some VB code that can be used to decrease a cell value if another cell's value is changed. e.g. I have a userform that has a Textbox that will put a 6 digit number in cell J4 & a Combobox that enters a number in cell E4. If the value of J4 is changed from the Textbox, I would like to have cell E4's value decrease by 1. If J4 doesn't change, cell E4 remains unchanged.
    Thank You
    abbeville

    Good afternoon: I have the following code in a template:


    When a user opens the template, Sheet1.Range("A2") is populated with today's date & Sheet1.Name becomes the user's name. How can I set this up so that the template, which is named Medical Records, is saved as a workbook named : Sheet1.Name & " Medical Records.xls"? In other words, if the user's name is Bill, I would like the workbook saved as Bill's Medical Records.
    Thank you
    abbeville

    Good Morning> Is it possible to adapt to the following


    and use it in the following code:

    Code
    '   Label's caption is the email address:
        Dim sEmailAddy As String
        sEmailAddy = "[email protected]"
    
    
        ShellExecute 0&, "open", "mailto:" & sEmailAddy, _
                     vbNullString, vbNullString, SW_SHOWNORMAL


    abbeville

    Good Morning. I have the following code in a macro that was working fine until I switched my OS to Vista


    Now I get a compile error message "User-Defined type not defined".
    Can someone please help me?
    Thank You
    abbeville

    Re: Vba Code To Open Cd Rom Device


    Good morning: My workbook was accidentally deleted so I had to build a new one. Like the "Six Million Dollar Man", better, faster, stronger. This time I used a userform with 1 command button.


    Code
    Private Sub UserForm_Initialize()
        CommandButton1.Caption = "Click Me"
    
    
    End Sub


    Code
    Private Sub Workbook_Open()
        Select Case Sheet1.Range("A1").Value
        Case Is = ""
        UserForm1.Show (vbModeless)
        End Select
    End Sub


    and the original code:


    abbeville

    Re: Vba Code To Open Cd Rom Device


    Good Morning Mudraker: I hope you don't mind but I borrowed your code for opening & closing the CD tray & modified it as follows. 1st I added a Userform with 2 commandbuttons on top of each other with the following code:


    then I added to your code as follows;


    abbeville

    I know you don't usually print userforms & when you do I know the code, however, how can you print one page of a multipage userform when the page
    has a vertical scrollbar & you want to print the whole page, not just what is showing on screen?
    Thank you
    abbeville

    Re: Retain Formula In Cell


    Hi Reafidy: I'm going to drop the problem for now. I can hide the whole worksheet without any problem. I'll just leave it like that.
    Thanks for your help.
    abbeville