Posts by Nobad

    Hi,


    I'm not sure if this is possible but I have a dashboard that shows a histogram with call duration in bins of 1 minute increments, this is taken from a pivot table which comes from a time column (00:00:00 format). The pivot table will not allow me to group the times together so i've used the analysis histogram. This works fine but has to be manually updated each time. I've tried to record a macro that automatically does this on a command button click but when I run the macro it tells me "Histogram - Input range missing. Please enter."


    I've tried to name the range but it still gives me the error. Here is my code:


    Once I run the histogram I'm updating my bins from range F4:F23 to show 0-1, 1-2 etc then re-calculate to show the new bins. Can you tell me if this is actually possible or if there is something I'm missing from my code?


    Thanks
    Nobad

    Re: Adding userform auto reference data to a hidden worksheet


    Thanks for the hint KjBox.


    What i've done now is this.



    All I had to do was reference the other worksheet in the Initialise. Is this the best way of doing this?


    Thanks
    Nobad

    Hi,


    I'm stumped! I have a userform that automatically generates a reference number when initialised (looks for previous number in first column and adds 1) What I want to do is have the data worksheet hidden so the user only uses the Userform, also to make it look clearer. The problem is after userform initialise it only looks at the visible worksheet. I can get this to work if the commandbutton to open the userform is placed on the data worksheet but would like this on a blank sheet. Here is what I've done so far ...



    Should I be referencing the worksheet somewhere in here? = Format(Val(Cells(Rows.Count, 1).End(xlUp)) + 1, "00000")


    Any help wopuld be great and any other info required please let me know.


    Thanks
    Nobad

    Re: Multiply 2 Combobox values into a Textbox


    Hi,


    Just solved my problem with this:

    Code
    Private Sub Combobox10_Change()
    If IsNumeric(Me!ComboBox1) And IsNumeric(Me!ComboBox10) Then
    TextBox1.Value = (Me!ComboBox1 * Me!ComboBox10)
    End If
    End Sub


    Love learning new stuff.


    Thanks Ozgrid
    Nobad

    Hi,


    I'm wondering if anyone can help. I'm creating a Userfom for the input of Claims but I'm stuck on how to add 2 values from teh combobox dropdowns to an adjacent text box. I'm trying this below but its not working and i'm not sure where to place it?


    Its trying to take hours worked in Combobox1 and multiply by the hourly rate in Combobox10 and outputting that result immediately into Textbox1.


    Code
    TextBox1.Value = Val(Me.ComboBox1.Value) * Val(Me.ComboBox10.Value)
    TextBox2.Value = Val(Me.ComboBox2.Value) * Val(Me.ComboBox11.Value)
    TextBox3.Value = Val(Me.ComboBox3.Value) * Val(Me.ComboBox12.Value)
    TextBox4.Value = Val(Me.ComboBox4.Value) * Val(Me.ComboBox13.Value)
    TextBox5.Value = Val(Me.ComboBox5.Value) * Val(Me.ComboBox14.Value)
    TextBox6.Value = Val(Me.ComboBox6.Value) * Val(Me.ComboBox15.Value)
    TextBox7.Value = Val(Me.ComboBox7.Value) * Val(Me.ComboBox16.Value)
    TextBox8.Value = Val(Me.ComboBox8.Value) * Val(Me.ComboBox17.Value)
    TextBox9.Value = Val(Me.ComboBox9.Value) * Val(Me.ComboBox18.Value)


    Any help would be much appreciated. I can post the full Code if needs be

    Re: Saving in 2 different places if Option Button True or False


    So what is wrong here?


    Code
    ActiveDocument.SaveAs2 FileName:="C:\Users\" & Environ$("USERPROFILE") & _
        "\Desktop\" & NameofFile & " - " & NameofSubject & ".doc", FileFormat:= _
            wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _
            False, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
            False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
            SaveAsAOCELetter:=False, CompatibilityMode:=0


    Its n ot a valid file name?

    Re: Saving in 2 different places if Option Button True or False


    Yes I did try USERPROFILE but couldnt get it to work. I didn't use DesktopLocation$ though. I'll try this.


    I have solved the issue another way which is unrelated to saving it twice. I create an automatic folder in C:\ as soon as the VB form is opened on any machine then save it to that. =)


    Code
    Dim x
    x = Shell("explorer /n,/e,C:\Reports", 1)End Sub


    Then with another macro I kill the folders once done with.


    Thanks for the quick reply though
    Nobad

    Hi,


    I'm wondering if anyone can help with what i'm trying to do here. I have a user form which will be used by 2 seperate groups of people. What I need to do is code in an automatic check of an option button and if true for Visit or Event save in a different place. One on a users desktop and one on a company laptop. The reason the Environ$("Username") doesn't work is that the laptops dont have logins. NOt an option to have 2 seperate forms either.


    This is my feeble attempt to do this. It basically just doesnt save now.



    Any help would be greatly appreciated


    Thanks
    Nobad

    Re: Running my VBA Userform on Mac?


    Hi,


    I've tried to upload the file but I think my work browser cant handle it (IE8) but I've just found VirtualBox. If a MAC OS is running Windows via VirtualBox would this let the User Form run?


    Nobad

    Re: Running my VBA Userform on Mac?


    Ah, that's a bit annoying. I require this to run across both platforms. I'm running 2010 on PC but I'll have to check whats on the Mac I used.


    Thanks for the link though.


    Nobad