Here the division spent the next few months alternating trench duties with working parties and training for the forthcoming Somme Offensive. For this the 49th Division formed the reserve for X Corps, which was tasked with seizing the Thiepval Spur, after which the 49th was to pass through and continue the pursuit. The 1/5th York & Lancasters moved up to assembly trenches in Aveluy Wood before dawn on the day of the attack (1 July), and at 13.30 moved up to the British front trenches alongside the River Ancre, Lt-Col Rendell taking C and D Companies to the south while Major Shaw took A and B Companies to the north. The battalion attempted to assist 108 Bde of the 36th (Ulster) Division, which had made good progress but had become cut off. After the failure of the first day, the York & Lancasters spent the next week in confused fighting along the Ancre. On 6 July, the battalion sent forward two bombing parties totalling seven officers and 80 other ranks to capture a trench: of these only 22 other ranks returned, the CO, Lt-Col Rendell, being left behind wounded in a German dugout, and Maj Shaw killed. By the time the battalion was relieved at 20.30 on 8 July it had suffered a total of 307 casualties. By 14 July the British had taken the Leipzig Redoubt on the Thiepval Spur, and while the offensive continued 49th Division remained holding this area, with a number of small actions and suffering a good deal of shelling, at the same time preparing trenches and dumps for a renewed attack. This attack was made on 3 September, at the end of the Battle of Pozières, but 5th York & Lancasters was not directly involved in the failed action. 49th Division continued minor operations towards Thiepval during the Battle of Flers-Courcelette (15–22 September) before the offensive petered out. During the summer of 1917 the 49th Division was earmarked for operations along the Flanders coast that failed to materialise. In October it was moved to the Ypres sector to join the Third Ypres Offensive. It took part in the Battle of Poelcapelle on 9 October, with 148 Bde on the left and 146 (1st West Yorkshire) Bde in the centre of the attack. The troops had a long night approach march in rain across appalling ground under shellfire, and only just reached the jumping-off tapes in time for Zero.