frobeniusabnorm
New Member
- Joined
- Jul 3, 2017
- Messages
- 15
- Office Version
- 365
- Platform
- Windows
Hello folks! I have a conundrum and I've not yet been able to successfully sift through the google results for a potential solution.
Have a worksheet with a bunch of client data that field crew use by entering a unique identifier and sending the document to that client. The main data tab stays hidden. Trying to make it so that all of the desired tabs are copied over away from that main report into a personalized one for that client. Mostly done that easily enough (code below) except I have a few formulas that rely on a dynamic month drop-down that uses that clients data specifically from the data tab.
So the question is: Is there a way I can add to my code so that it takes that unique identifier and copies ONLY the rows with that identifier from the main table over to the new document?
Note: It's conceivable this becomes a moot point, as we have done some Knime flows that create these individual sheets and mails them out before for other programs, but I'm a little concerned about the scale here, and even if that's not a problem, I'm still curious if this can be made a more on-demand thing via vba.
Thanks!
Have a worksheet with a bunch of client data that field crew use by entering a unique identifier and sending the document to that client. The main data tab stays hidden. Trying to make it so that all of the desired tabs are copied over away from that main report into a personalized one for that client. Mostly done that easily enough (code below) except I have a few formulas that rely on a dynamic month drop-down that uses that clients data specifically from the data tab.
So the question is: Is there a way I can add to my code so that it takes that unique identifier and copies ONLY the rows with that identifier from the main table over to the new document?
VBA Code:
Sub copysheets()
Dim wb As Workbook
Worksheets("Report Tab3").Visible = True
'Makes a copy of selected tabs and moves both to the same new workbook
Sheets(Array("Report Tab1", "Report Tab2", "Report Tab3")).Copy
Set wb = ActiveWorkbook
Worksheets("Report Tab3").Visible = False
'Breaks Links to the original workbook
BreakAllLinks wb
End Sub
Note: It's conceivable this becomes a moot point, as we have done some Knime flows that create these individual sheets and mails them out before for other programs, but I'm a little concerned about the scale here, and even if that's not a problem, I'm still curious if this can be made a more on-demand thing via vba.
Thanks!