Posts by Philosophaie

    I would like to list the files in a given folder on the network.

    I am getting an error on "dir1" where "Set objFolder = objFSO.GetFolder(dir1)":

    "Path not found"

    but the path exists!

    Please use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window.

    I’ve added them this time but please comply in the future

    I am trying to list all the subfolders in a folder.

    There are no error codes it just does not print out.

    I keep getting an "overflow" error on t1.
    There is a number in column F or JD from 2450000.5 to 2456666.5 in every one of the cells and each successive cell only differs by only 10 or so.
    No cell is empty throughout the range.

    Re: Comparing 1 column in 2 sheets and removing duplicate data

    You have to open the second book "Book2" from "Book1" Open. Book1 and Book2 can be any name example: File.xlsm and file2.xlsm.

    Sub Compare()
         For a = 1 To Workbooks("Book1").Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row        
             For b = 1 To Workbooks("Book2").Worksheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row
                If Workbooks("Book1").Worksheets("Sheet1").Range("A" & a) = Workbooks("Book2").Worksheets("Sheet1").Range("A" & b) Then
                    Workbooks("Book2").Worksheets("Sheet1").Range("A" & b).ClearContents
                End If
            Next b
        Next a
    end sub

    I am trying to sort in column "D" from cell "D9" to "Dmaxm". It gives me an error:

    "The sort reference is not valid.  Make sure that it's within the data you want to sort, and the first Sort By box isn't the same or blank."

    All the data is consecutive. Data is in each cell all the way to the last cell.

    Here is the sort program I am using:

    maxm = Sheets("Compare").Cells(Rows.Count, "D").End(xlUp).Row
        With ActiveWorkbook.Worksheets("Compare").Sort
            .SetRange Range("D9:D" & maxm)
            .Header = xlYes
            .MatchCase = False
            .Orientation = xlTopToBottom
            .SortMethod = xlPinYin
        End With

    I want to set the color of the line.

    With Sheets("Graph").ChartObjects("Chart 3")
            .Chart.SeriesCollection(1).XValues = Sheets("Data").Range("D2:D" & Sheets("Data").Cells(Rows.Count, "D").End(xlUp).Row)
            .Chart.SeriesCollection(1).Values = Sheets("Data").Range("E2:E" & Sheets("Data").Cells(Rows.Count, "E").End(xlUp).Row)
            .Chart.SeriesCollection(1).(What do I put here to set the color of the line)
    End With

    Max returns the value of "1" but there are over 1000 entries:

    Max = Sheets("Sheet1").Cells(Rows.Count, "A").End(xlUp).Row

    The numbers start in cell A1 and go over cell A1000. Every combination of Sheets(1), Sheets("Sheet1") has been tried still max=1.

    Re: Put in Excel Spreadsheet from a Function

    I think that is the problem "=func(D3:K3) is returning "#VALUE!". The function returned the values from "D3:K3" ok without the "Call printarr(arr)" but when I added it it went to the "#VALUE!" error and no printout in row 7.

    Re: Put in Excel Spreadsheet from a Function

    Moved subroutine to module:

    The function call "=func(D3:K3) "is now having an error: "#VALUE!""