Posts by CodeNerd

    I am creating a macro for merging multiple cells in column C based on the merged cells in column A. While doing this I want to retain all the values along with rich text formatting. For example if column A1:A3 is merged, I want to merge column C1:C3 while retaining all text in the cells with rich text formatting. I have created the code below and not sure how to proceed further. I could use some help here. Thanks.



    Hi All,
    Currently I am using the below code to delete the entire row if the mentioned strings matches in the cell value. I need a modification whereas, the row needs to be deleted if the cell matches the exact word.


    For example: If column B consist words like "test" and "latest" the code only needs to delete the word "test" leaving "latest".


    Thanks.


    Code
    strWords = "zz,*test*,tst"    For lng = LBound(Split(strWords, ",")) To UBound(Split(strWords, ","))
        Do
        On Error Resume Next
        rng.EntireRow.Delete
        Set rng = Cells.Find(What:=Split(strWords, ",")(lng), LookAt:=xlPart, MatchCase:=True)
        Err.Clear: On Error GoTo 0
        Loop Until rng Is Nothing
        Next lng

    Hi Guys,


    I am using below code to validate URL's on a excel and highlight the cell color respective of the validation. In this code for both 404 error page and redirection the cell is getting highlighted in dark grey. But, I need to change different color for redirection alone.


    Since, I am very new to VBA couldn't able to figure it out myself. I have googled and combined this code so far.


    Can somebody help please?


    Thanks in Advance.


    Re: VBA Code to Validate URL and Highlight Cells


    Hi SS,
    Thanks for your quick response. I am very new to VBA and I was using a code from one of existing sheet I have for this purpose.


    The problem with the below code is even though the URL is redirecting the cell will getting highlighted in green. I want the redirected cell to get highlighted in light grey.


    Can you able to modify it? Also, I am guessing the line ".Option(WinHttpRequestOption_EnableRedirects) = False" was not supposed to open the redirecting URL but, I believe it is opening the URL by omitting above command.



    Thanks

    Hey Guys,


    I have a column full of URL's(from cell B2 down). I just need a macro or something to validate each URL and highlight the cell with different color with respective of the results.


    If the URL is Valid, I want the cell color to be green.


    If the URL redirects, I want the cell color to be yellow.


    Finally, If the URL throws a 404 or any other error page, I want the cell color to be grey.


    few example URL's are:


    Valid One : [TABLE="width: 769"]

    [tr]


    [TD="class: xl64, width: 769"]https://www.wireless.att.com/b…0-bill-credit-details.jsp ( needs to be green)


    Redirected One: [TABLE="width: 769"]

    [tr]


    [TD="class: xl65, width: 769"]https://www.wireless.att.com/b…ns/200-port-in-credit.jsp (needs to be yellow)


    Error Page:[TABLE="width: 769"]

    [tr]


    [TD="class: xl65, width: 769"]https://www.wireless.att.com/b…/100-bill-credit-July.jsp (needs to be grey)[/TD]

    [/tr]


    [/TABLE]
    [/TD]

    [/tr]


    [/TABLE]
    [/TD]

    [/tr]


    [/TABLE]

    Please help, Thanks in Advance.