hexagon logo

Excel Reporting FCF

I am trying to develop an Excel macro to give the min/max measured value for each feature between every sheet. This is working fine so far, when my measured data appears in column E in excel.

The issue I am having is that if I have a routine that reports an FCF dimension, it shifts every column over 1, and my measured values now appear in column D. This renders my macro useless. I need to report FCF dimensions, so I can't uncheck that box on the Excel formatting tab. I have many different programs that may or may not report FCF dimensions, is there a way to report them without reporting the SEG=1 value?
  • I don't know what it looks like, but does the first line of the output say it is position, length, distance, whatever?

    If so, in code in Excel, read that, if it equals TP, Perp, Profile, etc. get value from D, else, get value from E.

    You are writing code already, use the code to get what you want from where you want. I'm presuming you are writing an actual macro and therefor are using VBA and can read/write/edit it.

    There must be some identifier that gives what you want.
    If not one cell, then read three cells, run an if on the values. If it is pushing one cell to the right for FCF, there is data in a cell for an FCF that is empty in non-FCF features, or vice-versa. If that cell is blank, read data from column E, if that cell has data, read the number from column D. Read the cell into a string variable and do isnull or ="", I don't remember which is VBA, maybe both.

    Its code, it will do whatever you write. Unlike a CMM, you can make it do almost anything.
  • I think Caemgen is right

    The macro only has to decide whether the line is FCF or Normal, then you can take the values from either E or D.

    This should be possible to implement, if you give us a bit of code we can help you​
  • Thanks for the info! I wasn't sure if there was a way to do it from PC-DMIS and I haven't used VBA very much.

    I was able to get a conditional set up and working. It seems the first measured value will either appear in E10, or G10 so I made a conditional to check the E9 label for "MEAS" and then pull E10 or G10 if true or false respectively.

    Range("C3").Select
    If Worksheets("PCDmisExcel1").Range("E9").Value = "MEAS" Then
    ActiveCell.FormulaR1C1 = "=MIN(PCDmisExcel1:PCDmisExcelEnd!R[7]C[2])"
    Else: ActiveCell.FormulaR1C1 = "=MIN(PCDmisExcel1:PCDmisExcelEnd!R[7]C[4])"
    End If​

    ​I am in C3 because that is where I will report the data in a new sheet. so R7C2 refers to E10 and R7C4 refers to G10
    after this portion, the macro copies the formula in the active cell and extrapolates down the column to report the rest of the dimensions.