Atom Index numbering: VMD, Gromacs gro-files, pdb-files

Does anyone have a clear description of how the index numbering differs between the three: in the visualisation of files in VMD (for example opening a gro file and labelling atoms, looking at the index number for that atom), the gro file and the pdb file.

I had a gro file which I looked at in VMD. I labelled atoms and wrote down the index number (graphics==> labels). Then I used gromacs to make a ndx-file keeping these atoms (in this case ions) and the protein, using the index numbers from VMD. However, out came a pdb-file (from using trjconv command ) not having the ions I wanted. So I’m assuming the numbering is off but instead of guessing (and maybe ending up with something that is only a coincidence that it works now) I wanted to ask.