Posts by Sainaa

    Hi,


    What would be the correct formula or VBA code for total hours calculations.
    If we had a meeting started on 1st Nov2016 at 6pm and finished 7.36 and then continued again next day. For example,[TABLE="width: 627"]

    [tr]


    [td]

    Date

    [/td]


    [td]

    Start

    [/td]


    [td]

    Suspend

    [/td]


    [td]

    Date

    [/td]


    [td]

    Reconvene

    [/td]


    [td]

    Finish

    [/td]


    [td]

    Total Hours

    [/td]


    [/tr]


    [tr]


    [TD="align: right"]1/11/2016[/TD]
    [TD="align: right"]6:20:00 p.m.[/TD]
    [TD="align: right"]7:36:00 p.m.[/TD]
    [TD="align: right"]2/11/2016[/TD]
    [TD="align: right"]9:34:00 a.m.[/TD]
    [TD="align: right"]11:54:00 a.m.[/TD]
    [TD="align: right"]???
    [/TD]

    [/tr]


    [/TABLE]

    Re: Combine 2 codes on one worksheet "Error message


    How to combine these two codes..please anyone!! Thank you


    Code
    Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
        If Intersect(Target, Range("g3:n500")) Is Nothing Then Exit Sub
        Target = Time
        Cancel = True
    End Sub
    Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
    If Intersect(Target, Range("e3:e500")) Is Nothing Then Exit Sub
        Target = Date
        Cancel = True
    End Sub

    Hi,


    How to combine these 2 codes, please help,


    Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
    If Intersect(Target, Range("c2:f500")) Is Nothing Then Exit Sub
    Target = Time
    Cancel = True
    End Sub
    Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As Boolean)
    If Intersect(Target, Range("b2:b100")) Is Nothing Then Exit Sub
    Target = Date
    Cancel = True
    End Sub

    Hi,
    I would like to pull out data automatically in Column A and Column B both by looking at another sheet , in my case"Coding 2" I would like meeting name in the B column.


    Have attached my excel spread sheet.


    At the moment, I can only have it in Column A with this code.




    Thank you


    Moderator Comment: Please use code tags. I have added them for you today.

    Hi,


    How do you combine these two codes one one sheet?


    I am getting all sorts of error messages.


    My coding is looking like this!


    Code
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
        If Intersect(Target, Range("g3:n500")) Is Nothing Then Exit Sub
        Target = Time
        Cancel = True
        ElseIf Not Intersect(Target, Range("E1:E500")) Is Nothing Then
            Target = Date
            Cancel = True
        End If
     Next
    End Sub


    Thank you


    Moderator comment. I have added code tags for you. Please read the forum rules and comply with them in the future.

    Hi,


    I have 1000s or raws of data looking like this,


    [TABLE="width: 738"]

    [tr]


    [td]

    Interaction ID

    [/td]


    [td]

    External Reference

    [/td]


    [td]

    External Reference1

    [/td]


    [td]

    External Reference 2

    [/td]


    [td]

    External Reference 3

    [/td]


    [/tr]


    [tr]


    [td]

    8140000000

    [/td]


    [td]

    PP

    [/td]


    [td]

    PP

    [/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [td]

    8140000002

    [/td]


    [td]

    RG, LS, LC

    [/td]


    [td]

    RG

    [/td]


    [td]

    LS

    [/td]


    [td]

    LC

    [/td]


    [/tr]


    [tr]


    [td]

    8140000030

    [/td]


    [td]

    RG, RFA, ACE

    [/td]


    [td]

    RG

    [/td]


    [td]

    RFA

    [/td]


    [td]

    ACE

    [/td]


    [/tr]


    [/TABLE]


    I would like to sort them like below faster way. How?? Thank you
    [TABLE="width: 220"]

    [tr]


    [TD="class: xl65, width: 111, bgcolor: transparent"]8140000000[/TD]
    [TD="class: xl66, width: 183, bgcolor: transparent"]PP[/TD]

    [/tr]


    [tr]


    [TD="class: xl65, bgcolor: transparent"]8140000002[/TD]
    [TD="class: xl66, bgcolor: transparent"]RG[/TD]

    [/tr]


    [tr]


    [TD="class: xl65, bgcolor: transparent"]8140000002[/TD]
    [TD="class: xl66, bgcolor: transparent"]LS[/TD]

    [/tr]


    [tr]


    [TD="class: xl65, bgcolor: transparent"]8140000002[/TD]
    [TD="class: xl66, bgcolor: transparent"]LC[/TD]

    [/tr]


    [tr]


    [TD="class: xl65, bgcolor: transparent"]8140000030[/TD]
    [TD="class: xl66, bgcolor: transparent"]RG[/TD]

    [/tr]


    [tr]


    [TD="class: xl65, bgcolor: transparent"]8140000030[/TD]
    [TD="class: xl66, bgcolor: transparent"]RFA[/TD]

    [/tr]


    [tr]


    [TD="class: xl65, bgcolor: transparent"]8140000030[/TD]
    [TD="class: xl66, bgcolor: transparent"]ACE


    [/TD]

    [/tr]


    [/TABLE]

    Why I am getting error message "Ambiguous name detected": Worksheet Change


    How can I fix it?


    The below here is my 3 coding



    Re: Choose text from drop down list will populate lists of texts automaticaly in next


    Hi,
    Where is the word "Fill"
    I tried to change the word from Fill to no Fill from your code, but cant find it.
    And my name list still stops at Column A23 even though there is no colouring...


    My code looks like this .


    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim rdata As Range
    Dim c As Range
    If Target.Address = ThisWorkbook.Names("meeting").RefersToRange.Address Then
    'If the dropdown was changed
    Select Case Target.Value
    Case "Environment and Community"
    Set rdata = ThisWorkbook.Names("Environment").RefersToRange
    Case "Audit and Risk"
    Set rdata = ThisWorkbook.Names("Audit").RefersToRange
    Case "Planning"
    Set rdata = ThisWorkbook.Names("Planning").RefersToRange
    End Select
    'Set rdata to the range of names to add
    For Each c In rdata.Cells
    If Target.Parent.Cells(65000, 1).End(xlUp).Row < 23 Then 'If there is still space in the table, add it to the last line
    Target.Parent.Cells(65000, 1).End(xlUp).Offset(1, 0).Value = c.Value
    End If
    Next
    End If
    End Sub