How to get the last value to be filled in the next empty cells untill the next value, like this 
I tried modifying 
Another option is to avoid the TRANSPOSE function, and just change VLOOKUP to HLOOKUP (as well as changing ROW to COLUMN:
=ARRAYFORMULA(HLOOKUP(column(B1:J1),FILTER({column(B1:J1);B1:J1},B1:J1<>""),2,TRUE))
