Posts by Domenic

    Try the following code . . .


    Hope this helps!

    To filter for values that start with "F" or values that contain 4 characters starting with "VMM", try...


    Code
    .AutoFilter Field:=113, Criteria1:="F*", Operator:=xlOr, Criteria2:="VMM?"


    Or do you specifically want to use a list as part of the criteria?

    So it looks like you're using the code that clicks the link. If you simply want check whether the link was found and clicked, you can use a Boolean variable to keep track of the status...


    Here's an example that loops through each link, checks for the text "Cash Flow", and then clicks the link...


    Code
    Dim HTMLLink As MSHTML.HTMLAnchorElement
    
    
        For Each HTMLLink In HTMLDoc.getElementsByTagName("a")
            If HTMLLink.innerText = "Cash Flow" Then
                HTMLLink.Click
                Exit For
            End If
        Next HTMLLink


    But this simply brings you to the table located at the bottom of the same page. If you want to access the information in that table, you can loop through each table on the page, and check for the text "Cash from Operating Activity" from the second row...


    Code
    Dim HTMLTable As MSHTML.HTMLTable
    
    
        For Each HTMLTable In HTMLDoc.getElementsByTagName("table")
            If HTMLTable.getElementsByTagName("tr")(1).Cells(0).innerText = "Cash from Operating Activity" Then
                'Do stuff
                Exit For
            End If
        Next HTMLTable


    Actually, instead of accessing the information from within this loop, you can exit it first, and then do so...





    Hope this helps!

    Try using the AutoFilter instead...



    Hope this helps!

    Re: VBA Array Furmula to Populate TextBox Data


    Assuming that the criteria are text values, try...


    Code
    Win = Evaluate("COUNTIFS('2008 - 2015'!B:B,""" & TB1 & """,'2008 - 2015'!D:D,""" & TB2 & """,'2008 - 2015'!H:H,""Win"",'2008 - 2015'!F:F,"""",'2008 - 2015'!G:G,"""")")


    For numerical values, you'll need to remove the quotes from the criteria. So, for example, let's say that the criteria for Column D is a numerical value, you would need to replace...


    Code
    """ & TB2 & """


    with


    Code
    " & TB2 & "


    Hope this helps!

    Re: VBA Array Furmula to Populate TextBox Data


    Here's a shortened version...



    Hope this helps!

    Re: VBA Array Furmula to Populate TextBox Data


    Try...



    Hope this helps!

    Re: Excel VBA SUM Specific Fields in Collumn


    Assuming that Sheet1 contains the column with the category fields, the following will place the total count for each each in B2:B4 of the sheet named National...



    Hope this helps!

    Re: it's possible no copy the macro on backup???


    Once you've initially saved your file, save it again as an .xlsx file under a different name (ie. Backup of Filename.xlsx)...


    Code
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs "c:\path\backup of filename.xlsx", xlOpenXMLWorkbook
    Application.DisplayAlerts = True


    Any VBA code will automatically be removed.


    Hope this helps!

    Re: Trying to Extract everthing before or after a certain phrase


    Quote from shawna98;745094

    That solved it! I am not familiar with LOOKUP(2^15, ... what is this telling the formula to do?


    When the lookup value for LOOKUP is a number and the number is greater than any other number in the lookup array, the last numerical value is returned. In this case, the lookup value is the number 2^15. And the array of values is returned by FIND. So the lookup number will always be greater than any number returned by FIND since the maximum characters allowed in a cell is 32,767 (the number 2^15 equates to 32,768 and, therefore, greater than the maximum of 32,767). Note that here LOOKUP ignores error values.


    Quote

    Thank you!!!!!!!


    You're very welcome!

    Re: VB code for add folder from exelsheet to outlook


    Do you mean that you'd like to add those folders to "In Behandeling", which is located in "Loket ASR SK Pensioenen Run"? If so, try...


    Code
    Set olMainFolder = olNS.Folders("Loket ASR SK Pensioenen Run").Folders("In Behandeling")

    Re: VB code for add folder from exelsheet to outlook


    Quote from Marktheshark;744615

    I don't get any message back when i enter the code:


    [ATTACH=CONFIG]64999[/ATTACH]


    As I have already mentioned, that line of code must be entered in the Immediate Window. From the menu in the Visual Basic Editor, select "View > Immediate Window". Or, alternatively, press Ctrl+R. This should bring up a small window, if it's not already visible. Type that line of code in that window, and press ENTER.


    See the attached file...

    Re: VB code for add folder from exelsheet to outlook


    Actually, when I said that you should go to the Visual Basic Editor, I meant in Outlook, not Excel. Sorry, I should have made it clear. So when you now try to enter that line of code in the Immediate Window of the Visual Basic Editor within Outlook, what do you get?

    Re: VB code for add folder from exelsheet to outlook


    Let's try to determine the path to your main folder/mailbox this way...


    1) In Outlook Mail, select the folder from the Folder pane in which you want your folders (ie. Work Mark, 1 Loket team Run inbox, Work John 1 Loket team Run inbox, etc) to reside.


    2) In the Visual Basic Editor (Alt+F11), enter the following line in the Immediate Window (Ctrl+R)...


    Code
    ? application.ActiveExplorer.CurrentFolder.FolderPath


    What path does it return?