I have the following macro that loops through a list of clients and saves individual workbooks for each client in a specific file location. The issue that is going over my head is I want to only save one particular worksheet in the workbook per client and not all of the tabs from the workbook.
Here is the entire macro:
Sub ClientDataRefresh()
With ThisWorkbook.Worksheets("Output")
Dim dvCell As Range
Dim inputRange As Range
Dim c As Range
Dim i As Long
'Cell that has data validation
Set dvCell = ThisWorkbook.Worksheets("Output").Range("C5")
'Determine where validation comes from
Set inputRange = Evaluate(dvCell.Validation.Formula1)
i = 1
'Begin loop
Application.ScreenUpdating = False
For Each c In inputRange
dvCell = c.Value
ThisWorkbook.RefreshAll
ThisWorkbook.Worksheets("Output").Range("A1:O10").Columns.AutoFit
With ThisWorkbook.Worksheets("Template")
LR = .Cells(Rows.Count, 7).End(xlUp).Row
10: If .Cells(LR, 7) = "" Then LR = LR - 1: GoTo 10
.PageSetup.PrintArea = "$A$1:$I$" & LR
End With
thisDate = Replace(Date, "/", "-")
thisName = Sheets("Template").Range("H7").Text
filePath = "C:\Users\nalanis\Dropbox (Decipher Dev)\Analytics\Sales\"
Application.DisplayAlerts = False
ThisWorkbook.Worksheets("Template").Select
ThisWorkbook.Worksheets("Template").Copy
ThisWorkbook.Worksheets("Template").SaveAs Filename:=filePath & thisName & " " & "Usage Report" & " " & thisDate & ".xlsx", FileFormat:=xlOpenXMLWorkbook
Application.DisplayAlerts = True
ActiveWorkbook.Close
Next c
End With
End Sub
I have tried looking and applying different potential solutions but no such luck.