Depending on his age, before or after. If he has bought his commission or qualified in a civilian capacity and gone straight into service, he might have got the rank early and then went on to WW1. If he is older in the Boer war, he might have been in India, Sudan perhaps, just that with his rank, you would think that he has done something other than the one war?
I had a look in the BMJ and can see his only daughter died in 1928 by which time his was already deceased. I cannot see an obituary for him (perhaps because he died in India?).
The medals were sold by Dominic Winter in Nov 2013. The listing stated:
Robert Selby was born 18 January 1875 at Kirkcowan, Wigtown, Dumfries and Galloway, Scotland.
Lieutenant 27 July 1898, Captain 27 July 1901, Major 27 April 1910.
Served in India 1902 - 04 and 1906 - 10. He died at Naina Tal, India on 10 October 1910.
He was a specialist in dermatology, obtaining his M.B (Bachelor of Medicine) Master of Surgery from the University of Edinburgh 1897.
The 1905 Army list only lists active service in the Boer War.
Selby,R. (Capt.R.A.Med.Corps)—S.African War, 1899-1903.—Operations in Natal, 99, including actions at Talana and Lombards Kop. Defence of Ladysmith. Operations in the Transvaal, east of Pretoria, Oct. to 29 Nov. 00. Operations in the Transvaal, 30 Nov. 00 to 31 May 02. Queen's medal with 3 clasps. King's medal with 2 clasps.
It is possible he had active service between 1905 and 1910.
Makes sense with the Capt rank and dying so early. Qualified and commissioned at 23 years old, but surprised his QSA has Capt on it? I am not sure but I suppose by the time it was signed off and issued, he had the rank, but clearly a Lieut during the first part of the war. No doubt if he had have lived, he would have ended up in WW1 doing very well, shame.