[SIZE=11px]Heey everyone.
I want to copy paste values from one w.b to another and save it by name of the value. [/SIZE]
- [SIZE=11px]go to the sheet "BA" ,refresh pivot and copy first value.[/SIZE]
- [SIZE=11px]find all results true for copied value, copy all and paste it to another w.b. "AMEX W8 BA.xlsx"[/SIZE]
- [SIZE=11px]save as by name of the value copied from first w.b / sheet "BA"[/SIZE]
- [SIZE=11px]repeat until the value at first w.b / sheet "BA" / column "A" is empty[/SIZE]
[SIZE=11px]I hope somebody can help me
THX[/SIZE]
Code
Sub BA()
Dim x As Integer
Sheets("BA").Select
ActiveSheet.PivotTables("tabella pivot1").PivotCache.Refresh
For x = 2 To 15
Sheets("DB").Select
ActiveSheet.Range("$A$1:$R$1000").AutoFilter field:=18, Criteria1:=Sheets("BA").Cells(x, 1).Value
Columns("A:AX").Select
Selection.Copy
Workbooks.Open ("C:\Users\Zurab_Pachoshvili\Desktop\MCRS Recording\AMEX W8 BA.xlsx")
ActiveSheet.Range("A1").PasteSpecial PASTE:=xlPasteValues
Filename = "C:\Users\Zurab_Pachoshvili\Desktop" & Range("R2").Value & ".xlsx"
ActiveWorkbook.SaveAs Filename:=Filename, FileFormat:=xlNorma
ActiveWindow.Close
Next
End Sub
Display More