Posts

Showing posts from February 17, 2019

Copy data from worksheets with partial name relation

Image
0 I am trying to copy data from every sheet in my workbook that has "ANALYSIS E 000002" and then "ANALYSIS E 000002" in its name, up to "ANALYSIS E 000012". Some have a copy number after this string, i.e. "ANALYSIS E 000002 (3)". So I started by doing a vba code that will take every sheet in the workbook and add their content in a combined one. It works perfectly but now I need to adapt it to select only the string I specify. I will need to do it for different names. Started with this code : Sub Combine_ea() Dim J As Integer On Error Resume Next Sheets(1).Select Worksheets.Add Sheets(1).Name = "Combined" Sheets(2).Activate Range("A1:A2").EntireRow.Select Selection.Copy Destination:=Sheets(1).Range("A1:A2") For J = 2 To Sheets.Coun