xlColId+something

JaydkJaydk Member Posts: 28
IF i have xlColId = H from the excelBuffer, and a number e.g. 2, how can i get xlColdId+2 = J

Comments

  • kinekine Member Posts: 12,562
    Try to use something like this:
    t := 'A';
    t[1] := t[1]+2;
    Message('%1',t);
    

    t is of type Text. You can "increase" character type by integer to get new character (of course only in values 0..255).
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • JaydkJaydk Member Posts: 28
    Nice.. That worked.. thanks alot
  • JaydkJaydk Member Posts: 28
    An extra question.. What happens when the excel sheet get so wide that the xlcolId is two letters like AA or AB?
  • kinekine Member Posts: 12,562
    You need to handle it. If the Caracter is Z, you need to continue with AA. If you have AZ, you need to increment to BA etc...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.