Posts by RBLearning

    Hi all, I have the code below but the only thing that's not working is the image file (the image is placed in cell 45), this isn't transferring to word. Can anyone shed any light as to what I'm doing wrong? Thanks in advance.


    Hi all,


    I've been working on a new userform and so far everything works out great apart from one thing. I just can't figure out how to count how many users are attending an event and send this to a word document.


    I select from a combobox a date of an event, a populated list displays (all working great) the list of guests. I then click (AttendPrintBtn) a button to print out the attendance sheet using the code below, but I just figure out the code to show how many users (brain freeze) are attending at the bottom, can someone be kind enough to help me out please?


    I'm using a comboboxes next to their name (data taken from a 'User' sheet) for me (cboAttend1 through to cboAttend5) to select if the guest have attended or not, if the guest attended then I select a forward slash / to show or A for absent - cboAttend1 = week 1, cboAttend2 = week 2, through to cboAttend5 for week 5.


    Here's praying - thanks in advance


    Hi all, can someone be kind enough to help me out here please? I have the following code below where the combobox lists dates from a column from my users sheet. All works well (apart from the dates are over the place and not in order) but I just can't seem to stop the duplicate dates showing in the drop down (I can't change the user sheet as data in there is required), does anyone know how to stop the duplicates and put it in date order? Thanks in advance.


    [VBA]Private Sub UserForm_Initialize()
    SortStartDateRange

    Dim ws As Worksheet
    Dim v
    Dim n As Long
    Set ws = Worksheets("Users")
    v = ws.Range("K2:K500").value
    For n = LBound(v) To UBound(v)
    v(n, 1) = Format(v(n, 1), "dd/mm/yyyy")
    Next
    Me.OutListCombo.List = v

    SortStartDateRange
    End Sub[/VBA]

    Hi all,


    I'm sure this is somewhere in the forum but after looking I can't find the correct information, I'm trying to populate a list into a listbox (called OutListBox) in a form.


    I have a column 'A' for the names and column 'O' for the responses. In the 'O' column I have 'Yes' or 'No', this shows me if the user has responded to a question.


    So what I'm trying to achieve is to have the following in the OutListBox: Display name and only display those who haven't replied.


    Then an ability to click on the name and send an email to the user. I have the following script but the dates are all wrong. Can someone be kind enough to check and correct my mistakes?


    [VBA]Private Sub UserForm_Initialize()

    OutListBox.Clear

    Dim ws As Worksheet
    Set ws = Worksheets("Users")


    Dim x As Integer, y As Integer, i As Integer
    y = ws.Cells(5000, 8).End(xlUp).row + 1

    i = 2

    For x = 2 To y

    With OutListBox
    .ColumnCount = 4
    .ColumnWidths = "20;100;100;90"

    'If we need to search all 4 date columns =
    'If Format(StartDate.Value, "DD/MM/YYYY") = Format(ws.Cells(x, 7).Value, "DD/MM/YYYY") or Format(StartDate.Value, "DD/MM/YYYY") = Format(ws.Cells(x, 8).Value, "DD/MM/YYYY") or Format(StartDate.Value, "DD/MM/YYYY") = Format(ws.Cells(x, 10).Value, "DD/MM/YYYY") or Format(StartDate.Value, "DD/MM/YYYY") = Format(ws.Cells(x, 11).Value, "DD/MM/YYYY") Then
    '.AddItem
    '.List(x - 2, 1) = Sheets("Users").Cells(x, 1).Value
    'End If
    If Format(OutListBox.Value, "DD/MM/YYYY") = Format(ws.Cells(x, 7).Value, "DD/MM/YYYY") Then
    .AddItem
    .List(i - 2, 1) = Sheets("Users").Cells(x, 1).Value
    .List(i - 2, 0) = x
    .List(i - 2, 2) = Sheets("Users").Cells(x, 8).Value
    .List(i - 2, 3) = Sheets("Users").Cells(x, 15).Value
    i = i + 1
    End If

    End With


    Next x


    End Sub[/VBA]

    Hiya,


    I've looked in the properties for the multiform but I can't see anywhere the feature to change the scrollbar colour; could someone please point me in the right direction?


    If this can't be done can a simple VBA script do this?


    Thanks in advance.

    Re: Date below set date not Valid entry


    Not to worry KJ, I've figured it out, code for others.


    I have a textbox called StartDate (inside a userform) where I enter a date of when a user joins, what I would like is that when I enter a date dd/mm/yyyy it checks to see if I've entered the month and the year (2017) above a certain time frame.


    For example:


    If I enter 01/08/2017 this is allowed (or any date after that date).


    If I enter 02/07/2017 a message will display that the date is not valid (or any date below that range, so if press 2016 instead of 2017).


    Is there a simple way of doing this please?

    Hi all, I hope someone can help me? I have the following code and I just can't seem to get the textbox (Name) and combobox (cbolocation) values to transfer to word, the StartDate works perfectly.


    Could someone please point me in the right direction as to what I'm doing wrong? Thanks in advance.


    Re: ComboBox Date Format not working


    I'm using this code and it's working perfectly (thanks for your help) but is there a way to modify the code if a different value is selected?



    What I would like to do is, if I select the value 'None assigned' from the combox 'cboDate' the calculation won't add the dates to the 'Reminder 1,3 & 6' textboxes; is this possible?


    Thank you in advance.

    Re: Search working but not correct!


    No merged cells. I'm still learning VBA and copied the code from elsewhere and playing around. Would you be kind enough to point me in the right direction as what to change?


    Thanks.

    I have the following coding to search for a user, everything works OK but I can't seem to get the results that I want displayed right.


    This is what I'm doing:
    Select date from a drop down list and press search - working


    Have the results show me the name (column a), location (column g) and the tutor (column h) from a sheet called 'Users'.


    The results come back with:
    Name (column a) department (column b) and job title (column c).


    Can someone enlighten me as to what I'm doing wrong please?



    Thank you in advance.

    Hi all,


    Just a thought, I'm not sure if this is possible and I've been trying to figure out how this could work. My idea is to select a given date from a comboBox, once selected the database will automatically give me a location where to attend.


    For example


    ComboBox date (dates are from a separate sheet populated).
    10/09/2017
    11/09/2017
    12/09/2017
    13/09/2017


    A text box will then show me the location (that has already been booked for that date), yet again populated from a list.


    Date Selected: 10/09/2017
    Location: Room 21


    I'm not sure how this could work, any thoughts (I'm not after any scripting, just a concept how it could work)?