You could use:
Thanks to X for pulling their weight doing Y while I was busy
But some people might find that the phrase 'pulling their weight' has implications that perhaps they might not have been pulling their weight before. It might be better to go with this sort of phrase:
Thanks to X for working extremely hard doing Y while I was busy; extremely grateful!
Or something like that. When you are writing your phrase try to bear in mind any implications that might arise due to words or phrases which may already have particular meanings within your workplace, too.
For example, if people have regularly and/or recently used 'hard' as a go-to sexual euphemism you might want to avoid it. Similarly, if there was an office meme saying: "you're all a bunch of dead-weights" or similar, or if the person has a known issue with their body-image, perhaps best avoid the weight one. So pick from what you have to-hand, but try to avoid anything that might be seen as insulting in the specific situation, and with the specific person, even if you don't mean it to be. Conversely, try to choose words and phrases with positive connotations, as much as possible (but not so much they lose their impact!).