I have had rethink and thought if I could get the process running with a smaller book that would be great
I receive a workbook with a list of providers and their assigned client s. At the moment I print each of these out using the page break macro to split them into the different providers for printing .See workbook one
I need to do some simple formatting to remove personal names etc and add a column for the providers comments .
I though that the formatting could be done with a simple macro recording see work book two .( i have added a sheet with the providers ID and email addresses)
I have found some code that would match ID from one sheet to another but as the work sheet is renamed it comes up with an error
If I got to this stage then I could use Kens suggestion of auto filter and emailing workbook based on current range shown
Looking at this request its getting very complicated is there a way to simplify ? Files attached
Dim i As Long, j As Long, lastrow1 As Long, lastrow2 As Long
Dim myname As String
lastrow1 = Sheets(“sheet1”).Range(“A” & Rows.Count).End(xlUp).RowFor i = 2To lastrow1
myname = Sheets(“sheet1”).Cells(i, “A”).ValueSheets(“sheet2”).Activate
lastrow2 = Sheets(“Sheet2”).Range(“A” & Rows.Count).End(xlUp).RowFor j = 2To lastrow2If Sheets(“sheet2”).Cells(j, “A”).Value = myname Then
Sheets(“sheet1”).Activate
Sheets(“sheet1”).Range(Cells(i, “B”), Cells(i, “F”)).Copy
Sheets(“sheet2”).Activate
Sheets(“sheet2”).Range(Cells(j, “D”), Cells(j, “H”)).Select
ActiveSheet.Paste
End If
Application.CutCopyMode = False
Next i
Sheets(“sheet1”).Activate
Sheets(“sheet1”).Range(“A1”).Select
End Sub
Workbook one.xlsmWorkbook Two.xlsm