Posts by mockingjay3

    I'm trying to run the code below to reformat data from the activesheet to a worksheet called "Input_Format_A" However, I get the error: "Object Required" when I hit the line ".Cells(.Cells(.Row.Count, ..." I tried adding Worksheets("Input_Format_A"). before the line but I still get the same error. I'm not sure what the needed syntax is.


    Re: Vba: Search column for urls, save webpages as individual text files


    Quote from John_w;651355

    Or is the error somewhere else?


    PS - I've not checked the logic of your code, just the syntax so that it compiles successfully.


    Thanks I got it to compile. But nothing happens when it runs now. Would you be able to check the logic of the code?


    Re: Vba: Search column for urls, save webpages as individual text files


    Quote from John_w;651306

    Or drop the If ... Else ... End If altogether and use:

    Code
    If InStr(1, Cells(myRow, 2).Value, "http:\\", vbTextCompare) Then Call url_Test(Cells(myRow, 2).Value, "C:\mallet\test\" & Cells(myRow, 1).Value & ".txt")
    myRow = myRow + 1



    Thanks for the reply! However, I'm still getting the same error for both ways.

    What I want this code to do is search in column B for urls (possibly using InStr(variable, "http://") as a boolean), and then save each webpage as an individual text file. I then need to name each text file with the text ID in column A. I get the wend without while error in the LoopColumnB sub.


    Here's my problem:


    I have a Text ID Column and a Text Column. I need to save each row of the Text Column into its own individual text file on my C: Drive. The name of the file should be the the Text ID from the first column. I need this to work with different sample data, so the number of rows will vary. I also need this to be able to work with excel files that contain thousands of rows.