I use Excel 2010 VBA code (see Pic-1) to generate PI Sampled Data for PI tags from cells B1 to F1. The output is from column A3 for PI tag in cell B1 with timestamps on column A and values on Column B, column C to F is for PI tags from cell C1 to F1. Column A and B generated timestamps and values for tag in cell B1 without problem, but from column C to F it shows #N/A for all values (see Pic-2). I have to right click 'Sampled Data...' on the cell A3 and click 'Apply' to show the values on the worksheet (see Pic-3). Can anyone provide suggestion to fix this problem? Thanks.