Q&A

  • Excel 저장
string grid내용을 엑셀로 옮기려는데

금액은 이런식으로

Excel.WorkSheets[1].Columns[1].NumberFormat := '#,##0';

Format을 주면 되는데..



문제는 Grid에 K100012001007이라는 문자열이 있는데

이것을 Format을 주려고 하는데..



이런식으로 말고 방법이 있는지

Copy(StringGrid.Cells[iCol,iRow], 1, 1) + '-' +

Copy(StringGrid.Cells[iCol,iRow], 2, 5) + '-' +

Copy(StringGrid.Cells[iCol,iRow], 7, 7)



K-10001-2001007

K-10001-2001008

K-10001-2001009

K-10001-2001010

어떻게 해야 하는지...



2  COMMENTS
  • Profile
    블랙봉 2001.07.10 19:16
    FormatMaskText('A-00000-0000000;0', StringGrid.Cells[iCol,iRow])



    이방인 wrote:

    > string grid내용을 엑셀로 옮기려는데

    > 금액은 이런식으로

    > Excel.WorkSheets[1].Columns[1].NumberFormat := '#,##0';

    > Format을 주면 되는데..

    >

    > 문제는 Grid에 K100012001007이라는 문자열이 있는데

    > 이것을 Format을 주려고 하는데..

    >

    > 이런식으로 말고 방법이 있는지

    > Copy(StringGrid.Cells[iCol,iRow], 1, 1) + '-' +

    > Copy(StringGrid.Cells[iCol,iRow], 2, 5) + '-' +

    > Copy(StringGrid.Cells[iCol,iRow], 7, 7)

    >

    > K-10001-2001007

    > K-10001-2001008

    > K-10001-2001009

    > K-10001-2001010

    > 어떻게 해야 하는지...

    >

  • Profile
    이방인 2001.07.10 19:42
    FormatMaskText('A-00000-0000000;0', StringGrid.Cells[iCol,iRow])

    이런식으로 바꿔놓고 하면 엑셀로 저장하면 저도 되는줄 아는데

    내가 원하는것은

    금액은

    XLApp.WorkSheets[1].Columns[1].NumberFormat := '#,##0';

    이렇게 NumberFormat이라는 속성이 있는데

    XLApp.WorkSheets[1].Columns[3].NumberFormat := 'A-00000-0000000';

    이렇게 NumberFormat말고 다른게 있는지를 묻는것입니다...



    그리고 엑셀을 실행하고 K100012001023치고 셀서식에서 사용자정의에서

    Format어떻게 줘야 K-10001-2001023 이렇게 변하는지....